From: yamaoka Date: Tue, 20 Feb 2001 05:49:30 +0000 (+0000) Subject: Synch with Oort Gnus. X-Git-Tag: t-gnus-6_15_0-09-quimby~18 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=d2032a52ac044ae4abe456a8a0075636a65ab394;p=elisp%2Fgnus.git- Synch with Oort Gnus. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 307170d..db16840 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,9 @@ -2001-02-19 21:00:00 ShengHuo ZHU +2001-02-20 00:00:00 ShengHuo ZHU - * nnweb.el (nnweb-type-definition): dejanews bought by google.com. - Beta is beta. + * nnweb.el (nnweb-request-group): Set nnweb-group anyway. + (nnweb-request-article): Call reference if exists. + (nnweb-type-definition): Dejanews is bought by google.com. + Beta! 2001-02-19 19:00:00 ShengHuo ZHU diff --git a/lisp/nnweb.el b/lisp/nnweb.el index cf18fb6..7aaa5f9 100644 --- a/lisp/nnweb.el +++ b/lisp/nnweb.el @@ -65,6 +65,7 @@ and `altavista'.") (dejanews ;; bought by google.com (article . nnweb-google-wash-article) (id . "http://groups.google.com/groups?as_umsgid=%s") + (reference . nnweb-google-reference) (map . nnweb-google-create-mapping) (search . nnweb-google-search) (address . "http://groups.google.com/groups") @@ -142,9 +143,10 @@ and `altavista'.") (when (and group (not (equal group nnweb-group)) (not nnweb-ephemeral-p)) + (setq nnweb-group group + nnweb-articles nil) (let ((info (assoc group nnweb-group-alist))) (when info - (setq nnweb-group group) (setq nnweb-type (nth 2 info)) (setq nnweb-search (nth 3 info)) (unless dont-check @@ -183,14 +185,17 @@ and `altavista'.") (and (stringp article) (nnweb-definition 'id t) (let ((fetch (nnweb-definition 'id)) - art) + art active) (when (string-match "^<\\(.*\\)>$" article) (setq art (match-string 1 article))) - (and fetch - art - (mm-with-unibyte-current-buffer - (nnweb-fetch-url - (format fetch article))))))) + (when (and fetch art) + (setq url (format fetch article)) + (mm-with-unibyte-current-buffer + (nnweb-fetch-url url)) + (if (nnweb-definition 'reference t) + (setq article + (funcall (nnweb-definition + 'reference) article))))))) (unless nnheader-callback-function (funcall (nnweb-definition 'article)) (nnweb-decode-entities)) @@ -697,7 +702,7 @@ and `altavista'.") ;;; (defun nnweb-google-wash-article () - (let ((case-fold-search t)) + (let ((case-fold-search t) url) (goto-char (point-min)) (re-search-forward "^
" nil t)
     (narrow-to-region (point-min) (point))
@@ -709,7 +714,7 @@ and `altavista'.")
     (while (search-forward "
" nil t) (replace-match "\n")) (nnweb-remove-markup) - (nnweb-decode-entities) + (goto-char (point-min)) (while (re-search-forward "^[ \t]*\n" nil t) (replace-match "")) (goto-char (point-max)) @@ -719,73 +724,89 @@ and `altavista'.") (search-forward "
" nil t) (delete-region (point) (point-max)) (nnweb-remove-markup) - (nnweb-decode-entities) (widen))) +(defun nnweb-google-parse-1 (&optional Message-ID) + (let ((i 0) + (case-fold-search t) + (active (cadr (assoc nnweb-group nnweb-group-alist))) + Subject Score Date Newsgroups From + map url) + (unless active + (push (list nnweb-group (setq active (cons 1 0)) + nnweb-type nnweb-search) + nnweb-group-alist)) + ;; Go through all the article hits on this page. + (goto-char (point-min)) + (while (re-search-forward + "a href=/groups\\(\\?[^ \">]*seld=[0-9]+[^ \">]*\\)" nil t) + (setq url + (concat (nnweb-definition 'address) + (match-string 1))) + (narrow-to-region (search-forward ">" nil t) + (search-forward "" nil t)) + (nnweb-remove-markup) + (nnweb-decode-entities) + (setq Subject (buffer-string)) + (goto-char (point-max)) + (widen) + (forward-line 2) + (when (looking-at "
]+>") + (goto-char (match-end 0))) + (if (not (looking-at "]+>")) + (skip-chars-forward " \t") + (narrow-to-region (point) + (search-forward "" nil t)) + (nnweb-remove-markup) + (nnweb-decode-entities) + (setq Newsgroups (buffer-string)) + (goto-char (point-max)) + (widen) + (skip-chars-forward "- \t")) + (when (looking-at + "\\([0-9]+/[A-Za-z]+/[0-9]+\\)[ \t]*by[ \t]*\\([^<]*\\) - ]*seld=[0-9]+[^ \">]*\\)" nil t) - (setq url - (concat (nnweb-definition 'address) - (match-string 1))) - (narrow-to-region (search-forward ">" nil t) - (search-forward "" nil t)) - (nnweb-remove-markup) - (nnweb-decode-entities) - (setq Subject (buffer-string)) - (goto-char (point-max)) - (widen) - (forward-line 2) - (when (looking-at "
]+>") - (goto-char (match-end 0))) - (if (not (looking-at "]+>")) - (skip-chars-forward " \t") - (narrow-to-region (point) - (search-forward "" nil t)) - (nnweb-remove-markup) - (nnweb-decode-entities) - (setq Newsgroups (buffer-string)) - (goto-char (point-max)) - (widen) - (skip-chars-forward "- \t")) - (when (looking-at - "\\([0-9]+/[A-Za-z]+/[0-9]+\\)[ \t]*by[ \t]*\\([^<]*\\) -