From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/61614 Path: news.gmane.org!not-for-mail From: Andreas Seltenreich Newsgroups: gmane.emacs.gnus.general Subject: nnweb fix Date: Sat, 31 Dec 2005 10:42:56 +0100 Message-ID: <877j9lob4v.fsf@gate450.dyndns.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1136022759 27046 80.91.229.2 (31 Dec 2005 09:52:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 31 Dec 2005 09:52:39 +0000 (UTC) Original-X-From: ding-owner+m10146@lists.math.uh.edu Sat Dec 31 10:52:36 2005 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EsdPb-0007Ea-PE for ding-account@gmane.org; Sat, 31 Dec 2005 10:52:32 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1EsdPU-0002qK-00; Sat, 31 Dec 2005 03:52:24 -0600 Original-Received: from nas01.math.uh.edu ([129.7.128.39]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1EsdGV-0002qF-00 for ding@lists.math.uh.edu; Sat, 31 Dec 2005 03:43:07 -0600 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas01.math.uh.edu with esmtp (Exim 4.52) id 1EsdGQ-0006nt-B3 for ding@lists.math.uh.edu; Sat, 31 Dec 2005 03:43:07 -0600 Original-Received: from smtp1.rz.uni-karlsruhe.de ([129.13.185.217]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1EsdGP-0006Ll-00 for ; Sat, 31 Dec 2005 10:43:01 +0100 Original-Received: from rzstud1.stud.uni-karlsruhe.de (rzstud1.stud.uni-karlsruhe.de [193.196.41.33]) by smtp1.rz.uni-karlsruhe.de with esmtp (Exim 4.43 #1) id 1EsdGM-0007ji-Gj; Sat, 31 Dec 2005 10:43:00 +0100 Original-Received: from uwi7 by rzstud1.stud.uni-karlsruhe.de with local (Exim 3.36 #1) id 1EsdGS-0001LW-00 for ding@gnus.org; Sat, 31 Dec 2005 10:43:05 +0100 Original-To: ding@gnus.org User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) X-PGP-Key: 0x2C006B340F8C8C1B X-Now-Playing: Melt Banana / Cell-scape X-Face: $:F<87a[gD1?#R6S3j21cr1&C&7bd63GHC.tSdskUb}hhwG(ci*=D5kJ<_N+p9q(7-,PnG. Et.Yh --=-=-= Hi, attached is an attempt to get web groups working again with the new google groups. regards, Andreas --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=nnweb.patch Index: lisp/nnweb.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/nnweb.el,v retrieving revision 7.10 diff -c -r7.10 nnweb.el *** lisp/nnweb.el 7 Sep 2005 13:50:08 -0000 7.10 --- lisp/nnweb.el 31 Dec 2005 09:32:34 -0000 *************** *** 27,37 **** ;; Note: You need to have `w3' installed for some functions to work. ! ;; FIXME: Due to changes in the HTML output of Google Groups and Gmane, stuff ! ;; related to web groups (gnus-group-make-web-group) doesn't work anymore. ! ! ;; Fetching an article by MID (cf. gnus-refer-article-method) over Google ! ;; Groups should work. ;;; Code: --- 27,34 ---- ;; Note: You need to have `w3' installed for some functions to work. ! ;; FIXME: Due to changes in the HTML output of Gmane, stuff related to ! ;; web groups doesn't work anymore. ;;; Code: *************** *** 61,66 **** --- 58,64 ---- (defvar nnweb-type-definition '((google (id . "http://www.google.com/groups?as_umsgid=%s&hl=en&dmode=source") + (result . "http://groups.google.com/group/%s/msg/%s?dmode=source") (article . nnweb-google-wash-article) (reference . identity) (map . nnweb-google-create-mapping) *************** *** 337,342 **** --- 335,341 ---- (mm-url-decode-entities)))) (defun nnweb-google-parse-1 (&optional Message-ID) + "Parse search result in current buffer." (let ((i 0) (case-fold-search t) (active (cadr (assoc nnweb-group nnweb-group-alist))) *************** *** 349,358 **** ;; Go through all the article hits on this page. (goto-char (point-min)) (while (re-search-forward ! "a href=/groups\\(\\?[^ \">]*selm=\\([^ &\">]+\\)\\)" nil t) ! (setq mid (match-string 2) url (format ! (nnweb-definition 'id) mid)) (narrow-to-region (search-forward ">" nil t) (search-forward "" nil t)) (mm-url-remove-markup) --- 348,360 ---- ;; Go through all the article hits on this page. (goto-char (point-min)) (while (re-search-forward ! "a +href=\"/group/\\([^>\"]+\\)/browse_thread/[^>]+#\\([0-9a-f]+\\)" nil t) ! (setq Newsgroups (match-string-no-properties 1) ! ;; Note: with groups-ng, mid is no longer a common ! ;; Message-ID, but some internal id. ! mid (match-string-no-properties 2) url (format ! (nnweb-definition 'result) Newsgroups mid)) (narrow-to-region (search-forward ">" nil t) (search-forward "" nil t)) (mm-url-remove-markup) *************** *** 360,384 **** (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)) ! (mm-url-remove-markup) ! (mm-url-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]*\\([^<]*\\) - - ") ! (setq From nil) (when (looking-at ! ">- \\([a-zA-Z]+\\) \\([0-9]+\\)\\(?: \\([0-9]\\{4\\}\\)\\)?, [^-<]+by \\([^<\n]+\\)\n") (setq From (match-string 4) Date (format "%s %s 00:00:00 %s" ! (match-string 1) ! (match-string 2) ! (or (match-string 3) ! (substring (current-time-string) -4))))) ! ! (unless From (debug)) ! ! (widen) (forward-line 1) (incf i) (unless (nnweb-get-hashtb url) *************** *** 419,425 **** (goto-char (point-min)) (incf i 100) (if (or (not (re-search-forward ! "]+\\).*Next" nil t)) (>= i nnweb-max-hits)) (setq more nil) ;; Yup, there are more articles --- 419,425 ---- (goto-char (point-min)) (incf i 100) (if (or (not (re-search-forward ! "\"]+\\)\">= i nnweb-max-hits)) (setq more nil) ;; Yup, there are more articles *************** *** 443,449 **** ("hl" . "en") ("lr" . "") ("safe" . "off") ! ("sites" . "groups"))))) t) (defun nnweb-google-identity (url) --- 443,450 ---- ("hl" . "en") ("lr" . "") ("safe" . "off") ! ("sites" . "groups") ! ("filter" . "0"))))) t) (defun nnweb-google-identity (url) --=-=-=--