From: Andreas Seltenreich <andreas+ding@gate450.dyndns.org>
Subject: nnweb fix
Date: Sat, 31 Dec 2005 10:42:56 +0100 [thread overview]
Message-ID: <877j9lob4v.fsf@gate450.dyndns.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 107 bytes --]
Hi,
attached is an attempt to get web groups working again with the new
google groups.
regards,
Andreas
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nnweb.patch --]
[-- Type: text/x-patch, Size: 5062 bytes --]
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 "</a>" 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 "</a>" nil t))
(mm-url-remove-markup)
***************
*** 360,384 ****
(setq Subject (buffer-string))
(goto-char (point-max))
(widen)
! (forward-line 2)
! (when (looking-at "<br><font[^>]+>")
! (goto-char (match-end 0)))
! (if (not (looking-at "<a[^>]+>"))
! (skip-chars-forward " \t")
! (narrow-to-region (point)
! (search-forward "</a>" 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]*\\([^<]*\\) - <a")
(setq From (match-string 4)
Date (format "%s %s 00:00:00 %s"
! (match-string 2) (match-string 1)
! (match-string 3))))
(forward-line 1)
(incf i)
(unless (nnweb-get-hashtb url)
--- 362,384 ----
(setq Subject (buffer-string))
(goto-char (point-max))
(widen)
! (narrow-to-region (point)
! (search-forward "</td" nil t))
!
! (search-backward ">- ")
! (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
! "<td nowrap><a href=\\([^>]+\\).*<span class=b>Next</span>" 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
! "<td><a href=\"\n\\([^>\"]+\\)\"><img src=\"/img/nav_next" nil t))
(>= 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)
next reply other threads:[~2005-12-31 9:42 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-31 9:42 Andreas Seltenreich [this message]
2005-12-31 10:48 ` Andreas Seltenreich
2006-01-04 0:18 ` Reiner Steib
2006-01-04 12:25 ` Andreas Seltenreich
2006-01-27 8:35 ` Andreas Seltenreich
2006-01-30 15:08 ` Reiner Steib
2006-01-31 5:48 ` Andreas Seltenreich
2006-01-31 16:03 ` Reiner Steib
2006-01-31 17:06 ` Andreas Seltenreich
2006-02-03 13:20 ` Reiner Steib
2006-02-12 6:34 ` Andreas Seltenreich
2006-02-13 13:35 ` Reiner Steib
2006-02-08 5:56 ` nnweb + Gmane search (was: nnweb fix) Andreas Seltenreich
2006-02-08 7:56 ` Olly Betts
2006-02-09 4:47 ` nnweb + Gmane search Andreas Seltenreich
2006-02-09 10:41 ` Olly Betts
2006-02-09 12:28 ` Olly Betts
2006-02-11 9:23 ` Andreas Seltenreich
2006-02-13 10:23 ` Olly Betts
2006-02-14 19:55 ` Andreas Seltenreich
2006-02-23 17:53 ` Reiner Steib
2006-02-23 23:04 ` Olly Betts
2006-02-24 0:49 ` Andreas Seltenreich
2006-02-24 12:07 ` Olly Betts
2006-02-24 14:31 ` Reiner Steib
2006-02-24 15:34 ` Olly Betts
2006-02-24 21:58 ` Andreas Seltenreich
2006-02-24 23:24 ` Reiner Steib
2006-04-22 10:42 nnweb fix Andreas Seltenreich
2006-04-23 14:12 ` Lars Magne Ingebrigtsen
2006-04-23 19:02 ` Tassilo Horn
2006-04-30 9:24 ` Lars Magne Ingebrigtsen
2006-04-30 11:10 ` Tassilo Horn
2006-04-30 11:31 ` Lars Magne Ingebrigtsen
2006-04-30 12:10 ` Tassilo Horn
2006-04-30 15:14 ` Tassilo Horn
2006-04-30 15:56 ` Andreas Seltenreich
2006-04-30 16:34 ` Tassilo Horn
2006-04-30 16:58 ` Andreas Seltenreich
2006-05-01 12:06 ` Lars Magne Ingebrigtsen
2006-05-01 12:09 ` Lars Magne Ingebrigtsen
2006-05-01 14:40 ` Tassilo Horn
2006-05-01 15:02 ` Lars Magne Ingebrigtsen
2006-05-01 16:38 ` Tassilo Horn
2006-05-01 16:52 ` Lars Magne Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877j9lob4v.fsf@gate450.dyndns.org \
--to=andreas+ding@gate450.dyndns.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).