Gnus development mailing list
 help / color / mirror / Atom feed
* nnweb fix
@ 2006-04-22 10:42 Andreas Seltenreich
  2006-04-23 14:12 ` Lars Magne Ingebrigtsen
  2006-04-23 19:02 ` Tassilo Horn
  0 siblings, 2 replies; 29+ messages in thread
From: Andreas Seltenreich @ 2006-04-22 10:42 UTC (permalink / raw)
  Cc: Tassilo Horn

[-- Attachment #1: Type: text/plain, Size: 498 bytes --]

Hi,

the google part of nnweb recently broke for me again (both, web groups
and referring articles). The attached patch seems to fix it.

I don't know if is related to the problems recently reported on
<info-gnus-english@gnu.org> though. While the symptoms are the same
(blank articles), I wasn't able to reproduce it back then, and web
groups weren't affected.

Thanks,
andreas

2006-04-22  Andreas Seltenreich  <uwi7@rz.uni-karlsruhe.de>

	* nnweb.el (nnweb-google-wash-article): Update regexp.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nnweb.patch --]
[-- Type: text/x-patch, Size: 943 bytes --]

Index: nnweb.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnweb.el,v
retrieving revision 7.19
diff -c -r7.19 nnweb.el
*** nnweb.el	4 Apr 2006 21:35:07 -0000	7.19
--- nnweb.el	22 Apr 2006 09:57:25 -0000
***************
*** 307,314 ****
  (defun nnweb-google-wash-article ()
    ;; We have Google's masked e-mail addresses here.  :-/
    (let ((case-fold-search t)
! 	(start-re "<pre>\n *")
! 	(end-re "\n *</pre>"))
      (goto-char (point-min))
      (if (save-excursion
  	  (or (re-search-forward "The requested message.*could not be found."
--- 307,314 ----
  (defun nnweb-google-wash-article ()
    ;; We have Google's masked e-mail addresses here.  :-/
    (let ((case-fold-search t)
! 	(start-re "<pre>[\r\n ]*")
! 	(end-re "[\r\n ]*</pre>"))
      (goto-char (point-min))
      (if (save-excursion
  	  (or (re-search-forward "The requested message.*could not be found."

^ permalink raw reply	[flat|nested] 29+ messages in thread
* nnweb fix
@ 2005-12-31  9:42 Andreas Seltenreich
  2005-12-31 10:48 ` Andreas Seltenreich
  0 siblings, 1 reply; 29+ messages in thread
From: Andreas Seltenreich @ 2005-12-31  9:42 UTC (permalink / 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)

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

end of thread, other threads:[~2006-05-01 16:52 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2005-12-31  9:42 Andreas Seltenreich
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

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).