1 |
;;; gnus-gl.el --- an interface to GroupLens for Gnus |
;;; gnus-gl.el --- an interface to GroupLens for Gnus |
2 |
|
|
3 |
;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 |
;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 |
4 |
;; Free Software Foundation, Inc. |
;; Free Software Foundation, Inc. |
5 |
|
|
6 |
;; Author: Brad Miller <bmiller@cs.umn.edu> |
;; Author: Brad Miller <bmiller@cs.umn.edu> |
131 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
132 |
|
|
133 |
(defvar gnus-summary-grouplens-line-format |
(defvar gnus-summary-grouplens-line-format |
134 |
"%U\%R\%z%l%I\%(%[%4L: %-20,20n%]%) %s\n" |
"%U\%R\%z%l%I\%(%[%4L: %-23,23n%]%) %s\n" |
135 |
"*The line format spec in summary GroupLens mode buffers.") |
"*The line format spec in summary GroupLens mode buffers.") |
136 |
|
|
137 |
(defvar grouplens-pseudonym "" |
(defvar grouplens-pseudonym "" |
342 |
|
|
343 |
(defun bbb-build-mid-scores-alist (groupname) |
(defun bbb-build-mid-scores-alist (groupname) |
344 |
"this function can be called as part of the function to return the list of score files to use. |
"this function can be called as part of the function to return the list of score files to use. |
345 |
See the gnus variable gnus-score-find-score-files-function. |
See the gnus variable `gnus-score-find-score-files-function'. |
346 |
|
|
347 |
*Note:* If you want to use grouplens scores along with calculated scores, |
*Note:* If you want to use grouplens scores along with calculated scores, |
348 |
you should see the offset and scale variables. At this point, I don't |
you should see the offset and scale variables. At this point, I don't |
510 |
;; Return an empty string |
;; Return an empty string |
511 |
"" |
"" |
512 |
(let* ((rate-string (make-string 12 ?\ )) |
(let* ((rate-string (make-string 12 ?\ )) |
513 |
(mid (mail-header-id header)) |
(mid (mail-header-id header)) |
514 |
(hashent (gnus-gethash mid grouplens-current-hashtable)) |
(hashent (gnus-gethash mid grouplens-current-hashtable)) |
515 |
(pred (or (nth 0 hashent) 0)) |
(pred (or (nth 0 hashent) 0)) |
516 |
(low (nth 1 hashent)) |
(low (nth 1 hashent)) |
517 |
(high (nth 2 hashent))) |
(high (nth 2 hashent))) |
518 |
;; Init rate-string |
;; Init rate-string |
519 |
(aset rate-string 0 ?|) |
(aset rate-string 0 ?|) |
520 |
(aset rate-string 11 ?|) |
(aset rate-string 11 ?|) |
632 |
|
|
633 |
(defun bbb-build-rate-command (rate-alist) |
(defun bbb-build-rate-command (rate-alist) |
634 |
(concat "putratings " grouplens-bbb-token " " grouplens-current-group " \r\n" |
(concat "putratings " grouplens-bbb-token " " grouplens-current-group " \r\n" |
635 |
(mapconcat '(lambda (this) ; form (mid . (score . time)) |
(mapconcat (lambda (this) ; form (mid . (score . time)) |
636 |
(concat (car this) |
(concat (car this) |
637 |
" :rating=" (cadr this) ".00" |
" :rating=" (cadr this) ".00" |
638 |
" :time=" (cddr this))) |
" :time=" (cddr this))) |
639 |
rate-alist "\r\n") |
rate-alist "\r\n") |
640 |
"\r\n.\r\n")) |
"\r\n.\r\n")) |
641 |
|
|
810 |
(if (null arg) (not gnus-grouplens-mode) |
(if (null arg) (not gnus-grouplens-mode) |
811 |
(> (prefix-numeric-value arg) 0))) |
(> (prefix-numeric-value arg) 0))) |
812 |
(when gnus-grouplens-mode |
(when gnus-grouplens-mode |
813 |
(make-local-hook 'gnus-select-article-hook) |
(gnus-make-local-hook 'gnus-select-article-hook) |
814 |
(add-hook 'gnus-select-article-hook 'grouplens-do-time nil 'local) |
(add-hook 'gnus-select-article-hook 'grouplens-do-time nil 'local) |
815 |
(make-local-hook 'gnus-exit-group-hook) |
(gnus-make-local-hook 'gnus-exit-group-hook) |
816 |
(add-hook 'gnus-exit-group-hook 'bbb-exit-group nil 'local) |
(add-hook 'gnus-exit-group-hook 'bbb-exit-group nil 'local) |
817 |
(make-local-variable 'gnus-score-find-score-files-function) |
(make-local-variable 'gnus-score-find-score-files-function) |
818 |
|
|