From: Rui-Tao Dong ~{6-HpLN~} <rdong@internetMCI.com>
Subject: DejaNews Rescued
Date: 22 Feb 1998 18:16:01 -0800 [thread overview]
Message-ID: <v5ra4vdq1p.fsf@Alpha.dfc.com> (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)
reply other threads:[~1998-02-23 2:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=v5ra4vdq1p.fsf@Alpha.dfc.com \
--to=rdong@internetmci.com \
/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).