Gnus development mailing list
 help / color / mirror / Atom feed
* updated nnweb
       [not found] <tkuk92x5wh3.fsf@zussun4.desy.de>
@ 1998-09-24  6:01 ` Rui-Tao Dong ~{6-HpLN~}
  1998-09-24 18:41   ` Julian Assange
  0 siblings, 1 reply; 2+ messages in thread
From: Rui-Tao Dong ~{6-HpLN~} @ 1998-09-24  6:01 UTC (permalink / raw)
  Cc: ascott


The following is a patch against 5.6.43.  It quite hackish, but seem
to work fine.  I've only tested the dejanews part under XEmacs 21.0b54 
under Cygwin32.

Regards,

Rui-Tao Dong ~{6-HpLN~}	<rdong@internetMCI.com>, Mission Viejo, California


*** nnweb.el	Wed Sep 23 13:25:02 1998
--- nnweb.el-old	Sat Aug 22 01:30:41 1998
***************
*** 55,67 ****
       (article . nnweb-dejanews-wash-article)
       (map . nnweb-dejanews-create-mapping)
       (search . nnweb-dejanews-search)
!      (address . "http://www.dejanews.com/dnquery.xp")
       (identifier . nnweb-dejanews-identity))
      (dejanewsold
       (article . nnweb-dejanews-wash-article)
       (map . nnweb-dejanews-create-mapping)
       (search . nnweb-dejanewsold-search)
!      (address . "http://www.dejanews.com/dnquery.xp")
       (identifier . nnweb-dejanews-identity))
      (reference
       (article . nnweb-reference-wash-article)
--- 55,67 ----
       (article . nnweb-dejanews-wash-article)
       (map . nnweb-dejanews-create-mapping)
       (search . nnweb-dejanews-search)
!      (address . "http://x8.dejanews.com/dnquery.xp")
       (identifier . nnweb-dejanews-identity))
      (dejanewsold
       (article . nnweb-dejanews-wash-article)
       (map . nnweb-dejanews-create-mapping)
       (search . nnweb-dejanewsold-search)
!      (address . "http://x8.dejanews.com/dnquery.xp")
       (identifier . nnweb-dejanews-identity))
      (reference
       (article . nnweb-reference-wash-article)
***************
*** 158,164 ****
      (let* ((header (cadr (assq article nnweb-articles)))
  	   (url (and header (mail-header-xref header))))
        (when (or (and url
! 		     (nnweb-fetch-url url header))
  		(and (stringp article)
  		     (nnweb-definition 'id t)
  		     (let ((fetch (nnweb-definition 'id))
--- 158,164 ----
      (let* ((header (cadr (assq article nnweb-articles)))
  	   (url (and header (mail-header-xref header))))
        (when (or (and url
! 		     (nnweb-fetch-url url))
  		(and (stringp article)
  		     (nnweb-definition 'id t)
  		     (let ((fetch (nnweb-definition 'id))
***************
*** 168,176 ****
  		       (and fetch
  			    art
  			    (nnweb-fetch-url
! 			     (format fetch article) header)))))
  	(unless nnheader-callback-function
! 	  (funcall (nnweb-definition 'article) header)
  	  (nnweb-decode-entities))
  	(nnheader-report 'nnweb "Fetched article %s" article)
  	t))))
--- 168,176 ----
  		       (and fetch
  			    art
  			    (nnweb-fetch-url
! 			     (format fetch article))))))
  	(unless nnheader-callback-function
! 	  (funcall (nnweb-definition 'article))
  	  (nnweb-decode-entities))
  	(nnheader-report 'nnweb "Fetched article %s" article)
  	t))))
***************
*** 289,295 ****
  	    (nnheader-set-temp-buffer
  	     (format " *nnweb %s %s %s*" nnweb-type nnweb-search server))))))
  
! (defun nnweb-fetch-url (url header)
    (save-excursion
      (if (not nnheader-callback-function)
  	(let ((buf (current-buffer)))
--- 289,295 ----
  	    (nnheader-set-temp-buffer
  	     (format " *nnweb %s %s %s*" nnweb-type nnweb-search server))))))
  
! (defun nnweb-fetch-url (url)
    (save-excursion
      (if (not nnheader-callback-function)
  	(let ((buf (current-buffer)))
***************
*** 300,313 ****
  	    (copy-to-buffer buf (point-min) (point-max))
  	    t))
        (nnweb-url-retrieve-asynch
!        url 'nnweb-callback (current-buffer) nnheader-callback-function header)
        t)))
  
! (defun nnweb-callback (buffer callback header)
    (when (gnus-buffer-live-p url-working-buffer)
      (save-excursion
        (set-buffer url-working-buffer)
!       (funcall (nnweb-definition 'article) header)
        (nnweb-decode-entities)
        (set-buffer buffer)
        (goto-char (point-max))
--- 300,313 ----
  	    (copy-to-buffer buf (point-min) (point-max))
  	    t))
        (nnweb-url-retrieve-asynch
!        url 'nnweb-callback (current-buffer) nnheader-callback-function)
        t)))
  
! (defun nnweb-callback (buffer callback)
    (when (gnus-buffer-live-p url-working-buffer)
      (save-excursion
        (set-buffer url-working-buffer)
!       (funcall (nnweb-definition 'article))
        (nnweb-decode-entities)
        (set-buffer buffer)
        (goto-char (point-max))
***************
*** 388,419 ****
  	  (goto-char (point-min))
  	  (nnweb-decode-entities)
  	  (goto-char (point-min))
! 	  (while (re-search-forward "^<tr valign=top>\n" nil t)
  	    (narrow-to-region
  	     (point)
! 	     (cond ((re-search-forward "^<tr valign=top>\n" nil t)
  		    (match-beginning 0))
  		   ((search-forward "\n\n" nil t)
  		    (point))
  		   (t
  		    (point-max))))
  	    (goto-char (point-min))
! 	    (if (re-search-forward "href=\\([^>]+\\)>" nil t)
! 		(setq url (match-string 1))
! 	      (setq url ""))
! 	    (goto-char (point-min))
! 	    (let ((begin (point)))
   	      (nnweb-remove-markup)
   	      (goto-char begin)
   	      (while (search-forward "\t" nil t)
   		(replace-match " "))
   	      (goto-char begin)
! 	      (beginning-of-line 2)
! 	      (setq begin (point))
! 	      (end-of-line)
   	      (setq Subject (buffer-substring begin (point)))
   	      (if (re-search-forward
!  		   "^Newsgroup: \\(.*\\)\nPosted on \\([0-9/]+\\) by \\(.*\\)$" nil t)
   		  (setq Newsgroup (match-string 1)
   			Date (match-string 2)
   			Author (match-string 3))))
--- 388,415 ----
  	  (goto-char (point-min))
  	  (nnweb-decode-entities)
  	  (goto-char (point-min))
! 	  (while (re-search-forward "^ <P>\n" nil t)
  	    (narrow-to-region
  	     (point)
! 	     (cond ((re-search-forward "^ <P>\n" nil t)
  		    (match-beginning 0))
  		   ((search-forward "\n\n" nil t)
  		    (point))
  		   (t
  		    (point-max))))
  	    (goto-char (point-min))
! 	    (looking-at ".*HREF=\"\\([^\"]+\\)\"\\(.*\\)")
! 	    (setq url (match-string 1))
!  	    (let ((begin (point)))
   	      (nnweb-remove-markup)
   	      (goto-char begin)
   	      (while (search-forward "\t" nil t)
   		(replace-match " "))
   	      (goto-char begin)
!  	      (end-of-line)
   	      (setq Subject (buffer-substring begin (point)))
   	      (if (re-search-forward
!  		   "^ Newsgroup: \\(.*\\)\n Posted on \\([0-9/]+\\) by \\(.*\\)$" nil t)
   		  (setq Newsgroup (match-string 1)
   			Date (match-string 2)
   			Author (match-string 3))))
***************
*** 442,471 ****
  	(setq nnweb-articles
  	      (sort (nconc nnweb-articles map) 'car-less-than-car))))))
  
! (defun nnweb-dejanews-wash-article (header)
!   (let ((case-fold-search t)
! 	url)
      (goto-char (point-min))
!     (re-search-forward "^<pre>" nil t)
      (delete-region (point-min) (point))
!     (goto-char (point-min))
!     (re-search-forward "^</pre>" nil t)
!     (re-search-forward "^</pre>" nil t)
      (delete-region (point) (point-max))
-     (goto-char (point-min))
-     (if (re-search-forward "href=\"\\([^\"]+\\)\">Get All [0-9]+ Segments"
- 			   nil t)
- 	(progn
- 	  (setq url (match-string 1))
- 	  (delete-region (point-min) (point-max))
- 	  (url-insert-file-contents url)
- 	  (nnweb-dejanews-wash-article header)))
-     (goto-char (point-min))
      (nnweb-remove-markup)
      (goto-char (point-min))
-     (if (re-search-forward "^\\[Subscribe to.*\n" nil t)
- 	(delete-region (match-beginning 0) (match-end 0)))
-     (goto-char (point-min))
      (while (and (looking-at " *$")
  		(not (eobp)))
        (gnus-delete-line))
--- 438,452 ----
  	(setq nnweb-articles
  	      (sort (nconc nnweb-articles map) 'car-less-than-car))))))
  
! (defun nnweb-dejanews-wash-article ()
!   (let ((case-fold-search t))
      (goto-char (point-min))
!     (re-search-forward "<PRE>" nil t)
      (delete-region (point-min) (point))
!     (re-search-forward "</PRE>" nil t)
      (delete-region (point) (point-max))
      (nnweb-remove-markup)
      (goto-char (point-min))
      (while (and (looking-at " *$")
  		(not (eobp)))
        (gnus-delete-line))
***************
*** 476,488 ****
        (replace-match "\n" t t))
      (goto-char (point-min))
      (when (search-forward "[More Headers]" nil t)
!       (replace-match "" t t))
!     (goto-char (point-min))
!     (insert (format "From: %s\n" (mail-header-from header)))
!     (insert (format "Subject: %s\n" (mail-header-subject header)))
!     (insert (format "Date: %s\n" (mail-header-date header)))
! ;;    (insert (format "Message-ID: %s\n" (mail-header-id header)))
!     (insert "\n")))
  
  (defun nnweb-dejanews-search (search)
    (nnweb-fetch-form
--- 457,463 ----
        (replace-match "\n" t t))
      (goto-char (point-min))
      (when (search-forward "[More Headers]" nil t)
!       (replace-match "" t t))))
  
  (defun nnweb-dejanews-search (search)
    (nnweb-fetch-form
***************
*** 514,520 ****
  
  (defun nnweb-dejanews-identity (url)
    "Return an unique identifier based on URL."
!   (if (string-match "hitnum=\\([0-9]+\\)" url)
        (match-string 1 url)
      url))
  
--- 489,495 ----
  
  (defun nnweb-dejanews-identity (url)
    "Return an unique identifier based on URL."
!   (if (string-match "recnum=\\([0-9]+\\)" url)
        (match-string 1 url)
      url))
  
***************
*** 576,582 ****
  	(setq nnweb-articles
  	      (sort (nconc nnweb-articles map) 'car-less-than-car))))))
  
! (defun nnweb-reference-wash-article (header)
    (let ((case-fold-search t))
      (goto-char (point-min))
      (re-search-forward "^</center><hr>" nil t)
--- 551,557 ----
  	(setq nnweb-articles
  	      (sort (nconc nnweb-articles map) 'car-less-than-car))))))
  
! (defun nnweb-reference-wash-article ()
    (let ((case-fold-search t))
      (goto-char (point-min))
      (re-search-forward "^</center><hr>" nil t)
***************
*** 702,708 ****
  	  (setq nnweb-articles
  		(sort (nconc nnweb-articles map) 'car-less-than-car)))))))
  
! (defun nnweb-altavista-wash-article (header)
    (goto-char (point-min))
    (let ((case-fold-search t))
      (when (re-search-forward "^<strong>" nil t)
--- 677,683 ----
  	  (setq nnweb-articles
  		(sort (nconc nnweb-articles map) 'car-less-than-car)))))))
  
! (defun nnweb-altavista-wash-article ()
    (goto-char (point-min))
    (let ((case-fold-search t))
      (when (re-search-forward "^<strong>" nil t)



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

* Re: updated nnweb
  1998-09-24  6:01 ` updated nnweb Rui-Tao Dong ~{6-HpLN~}
@ 1998-09-24 18:41   ` Julian Assange
  0 siblings, 0 replies; 2+ messages in thread
From: Julian Assange @ 1998-09-24 18:41 UTC (permalink / raw)
  Cc: ding, ascott

Rui-Tao Dong ~{6-HpLN~} <rdong@internetMCI.com> writes:

> The following is a patch against 5.6.43.  It quite hackish, but seem
> to work fine.  I've only tested the dejanews part under XEmacs 21.0b54 
> under Cygwin32.
> 
> Regards,
> 
> Rui-Tao Dong ~{6-HpLN~}	<rdong@internetMCI.com>, Mission Viejo, California

Do you have a version of this patch patch appropriate for Pterodactyl gnus?

Cheers,
Julian.


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

end of thread, other threads:[~1998-09-24 18:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <tkuk92x5wh3.fsf@zussun4.desy.de>
1998-09-24  6:01 ` updated nnweb Rui-Tao Dong ~{6-HpLN~}
1998-09-24 18:41   ` Julian Assange

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