2006-12-14 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de> (tiny change)
[gnus] / lisp / nnweb.el
index e93373e..ec450e7 100644 (file)
@@ -366,14 +366,15 @@ Valid types include `google', `dejanews', and `gmane'.")
       (mm-url-decode-entities)
       (search-backward " - ")
       (when (looking-at
-            " - \\([a-zA-Z]+\\) \\([0-9]+\\)\\(?: \\([0-9]\\{4\\}\\)\\)?, [^\n]+by \\([^<\n]+\\)\n")
-       (setq From (match-string 4)
-             Date (format "%s %s 00:00:00 %s"
+            "\\W+\\(\\w+\\) \\([0-9]+\\)\\(?: \\([0-9]\\{4\\}\\)\\)?")
+       (setq Date (format "%s %s 00:00:00 %s"
                           (match-string 1)
                           (match-string 2)
                           (or (match-string 3)
-                              (substring (current-time-string) -4)))))
-
+                              (substring (current-time-string) -4))))
+       (goto-char (match-end 0)))
+      (when (looking-at "[^b]+by\\W+\\([^<\n]+\\)")
+       (setq From (match-string 1)))
       (widen)
       (forward-line 1)
       (incf i)
@@ -416,7 +417,7 @@ Valid types include `google', `dejanews', and `gmane'.")
            (goto-char (point-min))
            (incf i 100)
            (if (or (not (re-search-forward
-                         "<a href=\"\n\\([^>\" \n\t]+\\)[^<]*<img src=[^>]+next"
+                         "<a [^>]+href=\"\n?\\([^>\" \n\t]+\\)[^<]*<img[^>]+src=[^>]+next"
                          nil t))
                    (>= i nnweb-max-hits))
                (setq more nil)
@@ -438,7 +439,8 @@ Valid types include `google', `dejanews', and `gmane'.")
     "?"
     (mm-url-encode-www-form-urlencoded
      `(("q" . ,search)
-       ("num" . "100")
+       ("num" . ,(number-to-string
+                 (min 100 nnweb-max-hits)))
        ("hq" . "")
        ("hl" . "en")
        ("lr" . "")
@@ -478,7 +480,7 @@ Valid types include `google', `dejanews', and `gmane'.")
                    (from (mail-header-from header))
                    (subject (mail-header-subject header))
                    (rfc2047-encoding-type 'mime))
-               (when (string-match " \\([^:]+\\):\\([0-9]+\\)" xref)
+               (when (string-match " \\([^:]+\\)[:/]\\([0-9]+\\)" xref)
                  (mail-header-set-xref
                   header
                   (format "http://article.gmane.org/%s/%s/raw"
@@ -494,16 +496,13 @@ Valid types include `google', `dejanews', and `gmane'.")
                                         (rfc2047-encode-string subject))
 
                (unless (nnweb-get-hashtb (mail-header-xref header))
-                 (push
-                  (list
-                   (incf (cdr active))
-                   header)
-                  map)
+                 (mail-header-set-number header (incf (cdr active)))
+                 (push (list (mail-header-number header) header) map)
                  (nnweb-set-hashtb (cadar map) (car map))))))
          (forward-line 1)))
       (nnheader-message 7 "Searching Gmane...done")
       (setq nnweb-articles
-           (sort (nconc nnweb-articles map) 'car-less-than-car)))))
+           (sort map 'car-less-than-car)))))
 
 (defun nnweb-gmane-wash-article ()
   (let ((case-fold-search t))
@@ -523,7 +522,9 @@ Valid types include `google', `dejanews', and `gmane'.")
     "?"
     (mm-url-encode-www-form-urlencoded
      `(("query" . ,search)
-       ("HITSPERPAGE" . ,(number-to-string nnweb-max-hits))))))
+       ("HITSPERPAGE" . ,(number-to-string nnweb-max-hits))
+       ;;("TOPDOC" . "500")
+       ))))
   (setq buffer-file-name nil)
   (set-buffer-multibyte t)
   (mm-decode-coding-region (point-min) (point-max) 'utf-8)