Gnus development mailing list
 help / color / mirror / Atom feed
* GroupLens
@ 1996-02-25  0:57 Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-02-25  0:57 UTC (permalink / raw)
  Cc: Brad Miller

I have been fiddling a bit with further integration of the GroupLens
code into Gnus proper to make it as easy as possible to use GroupLens.

I have done the following:

1)  Added a variable `gnus-use-grouplens'.  If it is non-nil, Gnus
will do the `bbb-login' and add `gnus-grouplens-mode' to
`gnus-summary-mode-hook'. 

2)  The GroupLens spec is now part of the default
`gnus-group-line-format'. 

3)  I have added a new variable, `gnus-summary-grouplens-line-format',
that is used as the format in all summary buffers that are GroupLens
enhanced. 

All you have to do now is:

(setq gnus-use-grouplens t)
(setq grouplens-pseudonym "your-pseudonym")

Included below is a patch to gnus-gl.el v2.5.  (I've also added a few
more defvars and stuff to make silence byte-compilation.)

Perhaps all the functions and variables in `gnus-gl' should start with
a common prefix to avoid inadvertantly clobbering other
functions/variables?  "bbb-"?  "gnus-gl-"?  "grouplens-"?

*** gnus-gl.el.old	Sun Feb 25 00:57:41 1996
--- gnus-gl.el	Sun Feb 25 01:48:55 1996
***************
*** 125,130 ****
--- 125,134 ----
  ;;;; User variables
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  
+ (defvar gnus-summary-grouplens-line-format
+   "%U%R%z%l%I%(%[%4L: %-20,20n%]%) %s\n"
+   "*The line format spec in summary GroupLens mode buffers.")
+ 
  (defvar grouplens-pseudonym ""
    "User's pseudonym.  This pseudonym is obtained during the registration process")
  
***************
*** 134,140 ****
  (defvar grouplens-bbb-port 9000 
    "Port where the bbbd is listening" )
  
! (defvar grouplens-newsgroups '("comp.lang.c++" "rec.humor" "rec.food.recipes"))
  
  (defvar grouplens-prediction-display 'prediction-spot
    "valid values are: 
--- 138,148 ----
  (defvar grouplens-bbb-port 9000 
    "Port where the bbbd is listening" )
  
! (defvar grouplens-newsgroups 
!   '("comp.lang.c++" "rec.humor" "rec.food.recipes" "comp.groupware"
!     "mn.general" "rec.arts.movies" "rec.arts.movies.current-films"
!     "comp.lang.java")
!   "*Groups that are part of the GroupLens experiment.")
  
  (defvar grouplens-prediction-display 'prediction-spot
    "valid values are: 
***************
*** 201,207 ****
  (defvar elapsed-time 0)
  
  (defvar previous-article nil)
! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;;;  Utility Functions
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  (defun connect-to-bbbd (host port)
--- 209,221 ----
  (defvar elapsed-time 0)
  
  (defvar previous-article nil)
! 
! (defvar process-buffer)
! (defvar bbb-read-point)
! (defvar bbb-response-point)
! (defvar login-response)
! 
! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;;;  Utility Functions
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  (defun connect-to-bbbd (host port)
***************
*** 336,342 ****
        (if bbb-process
  	  (save-excursion (set-buffer (process-buffer bbb-process))
  			  (bbb-send-command bbb-process predict-command)
! 			  (if (setq response (bbb-read-response bbb-process nil))
  			      (setq predict-list 
  				    (bbb-get-prediction-response bbb-process))
  			    (gnus-message 1 "Invalid Token, login and try again")
--- 350,356 ----
        (if bbb-process
  	  (save-excursion (set-buffer (process-buffer bbb-process))
  			  (bbb-send-command bbb-process predict-command)
! 			  (if (bbb-read-response bbb-process nil)
  			      (setq predict-list 
  				    (bbb-get-prediction-response bbb-process))
  			    (gnus-message 1 "Invalid Token, login and try again")
***************
*** 349,355 ****
  
  (defun get-all-mids ()
    (let ((index (nth 1 (assoc "message-id" gnus-header-index)))
! 	(articles gnus-newsgroup-headers))
      (setq bbb-mid-list nil)
      (while articles
        (progn (setq art (car articles)
--- 363,370 ----
  
  (defun get-all-mids ()
    (let ((index (nth 1 (assoc "message-id" gnus-header-index)))
! 	(articles gnus-newsgroup-headers)
! 	art this)
      (setq bbb-mid-list nil)
      (while articles
        (progn (setq art (car articles)
***************
*** 360,366 ****
    )
  
  (defun build-predict-command (mlist grpname token)
!   (let ((cmd (concat "getpredictions " token " " grpname "\r\n")))
      (while mlist
        (setq art (car mlist)
  	    cmd (concat cmd art "\r\n")
--- 375,382 ----
    )
  
  (defun build-predict-command (mlist grpname token)
!   (let ((cmd (concat "getpredictions " token " " grpname "\r\n"))
! 	art)
      (while mlist
        (setq art (car mlist)
  	    cmd (concat cmd art "\r\n")
***************
*** 443,448 ****
--- 459,467 ----
  (defconst grplens-minrating 1)
  (defconst grplens-predstringsize 12)
  
+ (defalias 'bbb-grouplens-score 'gnus-user-format-function-G)
+ 
+ (defvar gnus-tmp-score)
  (defun gnus-user-format-function-G (header)
    (let* ((rate-string (make-string 12 ? ))
  	 (mid
***************
*** 643,649 ****
  
  (defun build-rate-command (rate-alist)
    (let ((cmd (concat "putratings " grouplens-bbb-token 
! 		     " " grouplens-current-group " \r\n")))
      (while rate-alist
        (setq this (car rate-alist)
  	    cmd (concat cmd (car this) " :rating=" (cadr this) ".00"
--- 662,669 ----
  
  (defun build-rate-command (rate-alist)
    (let ((cmd (concat "putratings " grouplens-bbb-token 
! 		     " " grouplens-current-group " \r\n"))
! 	this)
      (while rate-alist
        (setq this (car rate-alist)
  	    cmd (concat cmd (car this) " :rating=" (cadr this) ".00"
***************
*** 714,720 ****
      (save-excursion
        (while scoring
  	(bbb-summary-rate-article score
! 				  (gnus-header-id
  				   (gnus-get-header-by-number 
  				    (gnus-summary-article-number))))
  	;; ...and go forward until either the buffer ends or the subtree
--- 734,740 ----
      (save-excursion
        (while scoring
  	(bbb-summary-rate-article score
! 				  (mail-header-id
  				   (gnus-get-header-by-number 
  				    (gnus-summary-article-number))))
  	;; ...and go forward until either the buffer ends or the subtree
***************
*** 736,742 ****
      (gnus-message 3 "You must select an article before you rate it")))
  
  
! 
  (defun gnus-user-format-function-I (header)
    (let ((gname (if (string-match "September" gnus-version)
  		   gnus-tmp-group
--- 756,762 ----
      (gnus-message 3 "You must select an article before you rate it")))
  
  
! (defvar gnus-tmp-group)
  (defun gnus-user-format-function-I (header)
    (let ((gname (if (string-match "September" gnus-version)
  		   gnus-tmp-group
***************
*** 746,752 ****
        ""))
  )
  
! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;          TIME SPENT READING
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  
--- 766,778 ----
        ""))
  )
  
! (defun bbb-grouplens-group-p (group)
!   "Say whether GROUP is a GroupLens group."
!   (if (member group grouplens-newsgroups)
!       " (GroupLens Enhanced)"
!     ""))
! 
! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;          TIME SPENT READING
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  
***************
*** 764,785 ****
  	(cadr timeval)))
  
  (defun grouplens-do-time ()
!   (if (member gnus-newsgroup-name grouplens-newsgroups)
!       (progn
! 	(cond ((not (null previous-article))
! 	       (setq  elapsed-time (grouplens-elapsed-time))
! 	       (if (not (setq oldrating (assoc previous-article
! 					       grouplens-rating-alist)))
! 		   (setq grouplens-rating-alist (cons (cons previous-article
! 							   (cons 0
! 								 elapsed-time))
! 						      grouplens-rating-alist))
! 		 (setcdr oldrating (cons (cadr oldrating) elapsed-time)))
! 	       ))
! 	(grouplens-start-timer)
! 	(setq previous-article (get-current-id)))
!     ) ; end if
! )
  
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
--- 790,812 ----
  	(cadr timeval)))
  
  (defun grouplens-do-time ()
!   (let (oldrating)
!     (if (member gnus-newsgroup-name grouplens-newsgroups)
! 	(progn
! 	  (cond ((not (null previous-article))
! 		 (setq  elapsed-time (grouplens-elapsed-time))
! 		 (if (not (setq oldrating (assoc previous-article
! 						 grouplens-rating-alist)))
! 		     (setq grouplens-rating-alist (cons (cons previous-article
! 							      (cons 0
! 								    elapsed-time))
! 							grouplens-rating-alist))
! 		   (setcdr oldrating (cons (cadr oldrating) elapsed-time)))
! 		 ))
! 	  (grouplens-start-timer)
! 	  (setq previous-article (get-current-id)))
!       )					; end if
!     ))
  
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
***************
*** 854,872 ****
  	  (if (null arg) (not gnus-grouplens-mode)
  	    (> (prefix-numeric-value arg) 0)))
      (when gnus-grouplens-mode
-       (add-hook 'gnus-startup-hook 'bbb-login)
-       (add-hook 'gnus-exit-gnus-hook 'bbb-logout)
        (make-local-hook 'gnus-select-article-hook)
        (add-hook 'gnus-select-article-hook 'grouplens-do-time)
        (make-local-hook 'bbb-put-ratings)
        (add-hook 'gnus-exit-group-hook 'bbb-put-ratings)
        (setq gnus-score-find-score-files-function 'bbb-build-mid-scores-alist)
  
        ;; Set up the menu.
        (when (and menu-bar-mode
  		 (gnus-visual-p 'grouplens-menu 'menu))
  	(gnus-grouplens-make-menu-bar)
! 	(easy-menu-add gnus-grouplens-menu))
        (unless (assq 'gnus-grouplens-mode minor-mode-alist)
  	(push '(gnus-grouplens-mode " GroupLens") minor-mode-alist))
        (unless (assq 'gnus-grouplens-mode minor-mode-map-alist)
--- 881,900 ----
  	  (if (null arg) (not gnus-grouplens-mode)
  	    (> (prefix-numeric-value arg) 0)))
      (when gnus-grouplens-mode
        (make-local-hook 'gnus-select-article-hook)
        (add-hook 'gnus-select-article-hook 'grouplens-do-time)
        (make-local-hook 'bbb-put-ratings)
        (add-hook 'gnus-exit-group-hook 'bbb-put-ratings)
        (setq gnus-score-find-score-files-function 'bbb-build-mid-scores-alist)
+       (make-local-variable 'gnus-summary-line-format)
+       (setq gnus-summary-line-format gnus-summary-grouplens-line-format)
+       (make-local-variable 'gnus-summary-line-format-spec)
  
        ;; Set up the menu.
        (when (and menu-bar-mode
  		 (gnus-visual-p 'grouplens-menu 'menu))
  	(gnus-grouplens-make-menu-bar)
! 	(easy-menu-add 'gnus-grouplens-menu))
        (unless (assq 'gnus-grouplens-mode minor-mode-alist)
  	(push '(gnus-grouplens-mode " GroupLens") minor-mode-alist))
        (unless (assq 'gnus-grouplens-mode minor-mode-map-alist)


-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@ifi.uio.no * Lars Ingebrigtsen


^ permalink raw reply	[flat|nested] 2+ messages in thread

* GroupLens
@ 1997-04-22 20:02 David L Leppik
  0 siblings, 0 replies; 2+ messages in thread
From: David L Leppik @ 1997-04-22 20:02 UTC (permalink / raw)


Over the next few day's I'm going to be updating the GroupLens support
in Gnus.  It looks like the main difference will be that connecting is
done first through the GroupLens Name Server (glens) rather than
directly to the Better Bit Bureau (or glurb, GroupLens Rating Burea;
we got in trouble with another BBB).

There may be some other minor changes in the protocol, though it's
pretty much the same.  We'll have support for both average and
personalized ratings, and the glurb reports back which is which, but
I'm not sure yet how (or if) to report that to the user.

Very soon we'll have another GroupLens trial up and running.  This
time we have funding to keep it going for at least three years.  We'll
have average ratings for comp.*, soc.*, talk.*, misc.*, and a few
others.  (Alt.* is a bit too big, at least at the moment.)
Personalized ratings will appear for some newsgroups, and ultimately
we may find a way to automatically switch personalized on and off
based on cost/benefit.

I have gnus-5.4.46, and plan to send you diffs, unless there's a
better way to do it.

	-Dave

-- 
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.                                                             .
. David Leppik, Computer Science graduate student             .
. leppik@cs.umn.edu http://www.cs.umn.edu/~leppik/            .
.                                                             .
. - -  -   -    -     -      -       -        -         -     .
. Try new GrepLens:  Using collaborative filtering to show    .
. you the part of the file you want to see.  GrepLens:        .
. putting the 'Rating System' back in 'Operating System.'     .
. http://www.cs.umn.edu/Research/GroupLens/                   .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-04-22 20:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-02-25  0:57 GroupLens Lars Magne Ingebrigtsen
1997-04-22 20:02 GroupLens David L Leppik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).