* DejaNews Rescued
@ 1998-02-23 2:16 Rui-Tao Dong ~{6-HpLN~}
0 siblings, 0 replies; only message in thread
From: Rui-Tao Dong ~{6-HpLN~} @ 1998-02-23 2:16 UTC (permalink / raw)
The following message is a courtesy copy of an article
that has been posted to gnu.emacs.gnus as well.
I really needed to search DejaNews and no one has stepped out to fix
nnweb so far. I have the following patch against nnweb in qgnus 0.29 (tested
pnly in Gnus v5.4.37 and 5.4.66.)
Regards,
Rui-Tao Dong ~{6-HpLN~} <rdong@internetMCI.com>, Mission Viejo, California
*** nnweb-new.el Fri Feb 20 21:06:28 1998
--- nnweb.el Sat Feb 14 10:28:00 1998
***************
*** 53,65 ****
(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)
--- 53,65 ----
(article . nnweb-dejanews-wash-article)
(map . nnweb-dejanews-create-mapping)
(search . nnweb-dejanews-search)
! (address . "http://x5.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://x5.dejanews.com/dnquery.xp")
(identifier . nnweb-dejanews-identity))
(reference
(article . nnweb-reference-wash-article)
***************
*** 79,85 ****
(defvoo nnweb-search nil
"Search string to feed to DejaNews.")
! (defvoo nnweb-max-hits 999
"Maximum number of hits to display.")
(defvoo nnweb-ephemeral-p nil
--- 79,85 ----
(defvoo nnweb-search nil
"Search string to feed to DejaNews.")
! (defvoo nnweb-max-hits 100
"Maximum number of hits to display.")
(defvoo nnweb-ephemeral-p nil
***************
*** 379,431 ****
(case-fold-search t)
(active (or (cadr (assoc nnweb-group nnweb-group-alist))
(cons 1 0)))
! Subject (Score "0") Date Newsgroup Author
map url)
(while more
;; Go through all the article hits on this page.
(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))))
(widen)
(incf i)
(unless (nnweb-get-hashtb url)
(push
(list
(incf (cdr active))
(make-full-mail-header
! (cdr active) Subject Author Date
(concat "<" (nnweb-identifier url) "@dejanews>")
nil 0 (string-to-int Score) url))
map)
(nnweb-set-hashtb (cadar map) (car map))))
;; See whether there is a "Get next 20 hits" button here.
(if (or (not (re-search-forward
! "HREF=\"\\([^\"]+\\)\"[<>b]+Next result" nil t))
(>= i nnweb-max-hits))
(setq more nil)
;; Yup -- fetch it.
--- 379,427 ----
(case-fold-search t)
(active (or (cadr (assoc nnweb-group nnweb-group-alist))
(cons 1 0)))
! Subject Score Date Newsgroup Author
map url)
(while more
;; Go through all the article hits on this page.
(goto-char (point-min))
(nnweb-decode-entities)
(goto-char (point-min))
! (while (re-search-forward "^ +[0-9]+\\." nil t)
(narrow-to-region
(point)
! (cond ((re-search-forward "^ +[0-9]+\\." nil t)
(match-beginning 0))
((search-forward "\n\n" nil t)
(point))
(t
(point-max))))
(goto-char (point-min))
! (when (looking-at ".*HREF=\"\\([^\"]+\\)\"")
! (setq url (match-string 1)))
! (nnweb-remove-markup)
! (goto-char (point-min))
! (while (search-forward "\t" nil t)
! (replace-match " "))
! (goto-char (point-min))
! (while (re-search-forward "^ +\\([^:]+\\): +\\(.*\\)$" nil t)
! (set (intern (match-string 1)) (match-string 2)))
(widen)
+ (when (string-match "#[0-9]+/[0-9]+ *$" Subject)
+ (setq Subject (substring Subject 0 (match-beginning 0))))
(incf i)
(unless (nnweb-get-hashtb url)
(push
(list
(incf (cdr active))
(make-full-mail-header
! (cdr active) (concat "(" Newsgroup ") " Subject) Author Date
(concat "<" (nnweb-identifier url) "@dejanews>")
nil 0 (string-to-int Score) url))
map)
(nnweb-set-hashtb (cadar map) (car map))))
;; See whether there is a "Get next 20 hits" button here.
(if (or (not (re-search-forward
! "HREF=\"\\([^\"]+\\)\">Get next" nil t))
(>= i nnweb-max-hits))
(setq more nil)
;; Yup -- fetch it.
***************
*** 464,472 ****
("defaultOp" . "AND")
("svcclass" . "dncurrent")
("maxhits" . "100")
! ("format" . "verbose2")
("threaded" . "0")
! ("showsort" . "date")
("agesign" . "1")
("ageweight" . "1")))
t)
--- 460,468 ----
("defaultOp" . "AND")
("svcclass" . "dncurrent")
("maxhits" . "100")
! ("format" . "verbose")
("threaded" . "0")
! ("showsort" . "score")
("agesign" . "1")
("ageweight" . "1")))
t)
***************
*** 478,486 ****
("defaultOp" . "AND")
("svcclass" . "dnold")
("maxhits" . "100")
! ("format" . "verbose2")
("threaded" . "0")
! ("showsort" . "date")
("agesign" . "1")
("ageweight" . "1")))
t)
--- 474,482 ----
("defaultOp" . "AND")
("svcclass" . "dnold")
("maxhits" . "100")
! ("format" . "verbose")
("threaded" . "0")
! ("showsort" . "score")
("agesign" . "1")
("ageweight" . "1")))
t)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1998-02-23 2:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-02-23 2:16 DejaNews Rescued Rui-Tao Dong ~{6-HpLN~}
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).