From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/20146 Path: main.gmane.org!not-for-mail From: Rui-Tao Dong ~{6-HpLN~} Newsgroups: gmane.emacs.gnus.general Subject: Another nnweb patch Date: 07 Jan 1999 19:00:48 -0800 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035158492 16202 80.91.224.250 (21 Oct 2002 00:01:32 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 00:01:32 +0000 (UTC) Return-Path: Original-Received: from karazm.math.uh.edu (karazm.math.uh.edu [129.7.128.1]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id WAA18463 for ; Thu, 7 Jan 1999 22:02:55 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by karazm.math.uh.edu (8.9.1/8.9.1) with ESMTP id VAB02631; Thu, 7 Jan 1999 21:01:53 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 07 Jan 1999 21:01:30 -0600 (CST) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.7.3/8.7.3) with ESMTP id VAA13082 for ; Thu, 7 Jan 1999 21:01:18 -0600 (CST) Original-Received: from Alpha.dfc.com (cx40455-a.msnv1.occa.home.com [24.1.130.158]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id WAA18395 for ; Thu, 7 Jan 1999 22:01:08 -0500 (EST) Original-Received: (from rdong@localhost) by Alpha.dfc.com (8.8.7/8.8.7) id TAA00486; Thu, 7 Jan 1999 19:00:49 -0800 X-Authentication-Warning: Alpha.dfc.com: rdong set sender to rdong@cwixmail.com using -f Original-To: ding@gnus.org X-Mailer: Gnus v5.6.44/XEmacs 20.4 - "Emerald" Original-Lines: 223 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:20146 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:20146 I did another nnweb patch (against v5.6.45) for DejaNews. Let me know if there is any problem. -- Rui-Tao Dong ~{6-HpLN~} , Mission Viejo, California --- nnweb.el Wed Jan 6 15:50:08 1999 +++ nnweb.el-orig Sat Aug 22 01:30:41 1998 @@ -55,13 +55,13 @@ (article . nnweb-dejanews-wash-article) (map . nnweb-dejanews-create-mapping) (search . nnweb-dejanews-search) - (address . "http://www.dejanews.com/dnquery.xp") + (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://www.dejanews.com/dnquery.xp") + (address . "http://x8.dejanews.com/dnquery.xp") (identifier . nnweb-dejanews-identity)) (reference (article . nnweb-reference-wash-article) @@ -354,10 +354,6 @@ (replace-match (char-to-string (or (cdr (assq (intern (match-string 1)) w3-html-entities)) ?#)) - t t)) - (goto-char (point-min)) - (while (re-search-forward "&#\\([0-9]+\\);" nil t) - (replace-match (char-to-string (string-to-number (match-string 1))) t t))) (defun nnweb-remove-markup () @@ -385,111 +381,96 @@ (case-fold-search t) (active (or (cadr (assoc nnweb-group nnweb-group-alist)) (cons 1 0))) - Subject Score Date Newsgroup Author - map url beginning-of-listing end-of-listing) + 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)) - (if (re-search-forward "^
$" nil t)
-	      (progn
-		(setq beginning-of-listing (point))
-		(setq end-of-listing (or 
-				      (re-search-forward "^
$" nil t) - (point-max))) - (goto-char beginning-of-listing) - (while (re-search-forward - (mapconcat 'identity - '("^[ \t]+[0-9]+\\." - "\\([0-9/]+\\)" - "\\([0-9]+\\)" - "\\(.*\\)" - "\\(.*\\)[ \t]*" - "]*>\\(.*\\)[ \t]*$") - "[ \t]*") end-of-listing t) - (setq Date (match-string 1)) - (setq Score (match-string 2)) - (setq url (concat (match-string 3) "&AH=1")) - (setq Subject (match-string 4)) - (setq Newsgroup (match-string 5)) - (setq Author (match-string 6)) - (incf i) - (unless (nnweb-get-hashtb url) - (push - (list - (incf (cdr active)) - (make-full-mail-header - (cdr active) - (format "%s [%s]" Subject Newsgroup) - 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 "Next matches" button here. - (if (or (not (re-search-forward - "HREF=\"\\([^\"]+\\)\"[<>b]+Next matches" nil t)) - (>= i nnweb-max-hits)) - (setq more nil) - ;; Yup -- fetch it. - (setq more (match-string 1)) - (erase-buffer) - (url-insert-file-contents more))) + (while (re-search-forward "^

\n" nil t) + (narrow-to-region + (point) + (cond ((re-search-forward "^

\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. + (setq more (match-string 1)) + (erase-buffer) + (url-insert-file-contents more))) ;; Return the articles in the right order. (setq nnweb-articles (sort (nconc nnweb-articles map) 'car-less-than-car)))))) (defun nnweb-dejanews-wash-article () - (let ((case-fold-search t) - head-beginning head-end) - (goto-char (point-max)) - (if (re-search-backward "^$" nil t) - (delete-region (match-beginning 0) (point-max))) - (if (re-search-backward "^

" nil t)
-	(let ((article-beginning (match-end 0)))
-	  (narrow-to-region article-beginning (point-max))
-	  (nnweb-decode-entities)
-	  (widen)
-	  (setq head-end (or (and (re-search-backward "$" nil t 2)
-				  (re-search-backward "^" nil t)
+    (delete-region (point-min) (point))
+    (re-search-forward "
" nil t) + (delete-region (point) (point-max)) + (nnweb-remove-markup) + (goto-char (point-min)) + (while (and (looking-at " *$") + (not (eobp))) + (gnus-delete-line)) + (while (looking-at "\\(^[^ ]+:\\) *") + (replace-match "\\1 " t) + (forward-line 1)) + (when (re-search-forward "\n\n+" nil t) + (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 (nnweb-definition 'address) `(("query" . ,search) ("defaultOp" . "AND") - ("DBS" . "1") - ("ST" . "PS") - ("LNG" . "ALL") + ("svcclass" . "dncurrent") ("maxhits" . "100") - ("format" . "terse") + ("format" . "verbose2") + ("threaded" . "0") ("showsort" . "date") - )) + ("agesign" . "1") + ("ageweight" . "1"))) t) (defun nnweb-dejanewsold-search (search)