X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fnnslashdot.el;h=7d7ebf4b67bc7fdf60068794a5229360746a60e5;hb=94102096dcc7f145e9f43117d945d9ed2e0ebd11;hp=1d1491e208a39c2371cfe01ba81315c2691af720;hpb=e5e546ca39d7a1f71e97cbae53238de314e23b8b;p=gnus diff --git a/lisp/nnslashdot.el b/lisp/nnslashdot.el index 1d1491e20..7d7ebf4b6 100644 --- a/lisp/nnslashdot.el +++ b/lisp/nnslashdot.el @@ -1,5 +1,5 @@ ;;; nnslashdot.el --- interfacing with Slashdot -;; Copyright (C) 1999 Free Software Foundation, Inc. +;; Copyright (C) 1999, 2000 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen ;; Keywords: news @@ -322,7 +322,7 @@ (when (numberp article) (if (= article 1) (progn - (re-search-forward "Posted by <[^>]+>[^>]*<[^>]+> on ") + (re-search-forward "Posted by *<[^>]+>[^>]*<[^>]+> *on ") (search-forward "
") (setq contents (buffer-substring @@ -344,7 +344,7 @@ (erase-buffer) (insert contents) (goto-char (point-min)) - (while (search-forward "

" nil t) + (while (re-search-forward "\\(
\r?\\)+" nil t) (replace-match "

" t t)) (goto-char (point-min)) (insert "Content-Type: text/html\nMIME-Version: 1.0\n") @@ -377,11 +377,12 @@ (narrow-to-region (point) (search-forward "")) (goto-char (point-min)) (re-search-forward "\\([^<]+\\)") - (setq description (nnweb-decode-entities-string (match-string 1))) + (setq description + (nnweb-decode-entities-string (match-string 1))) (re-search-forward "\\([^<]+\\)") (setq sid (match-string 1)) - (string-match "/\\([0-9/]+\\).shtml" sid) - (setq sid (match-string 1 sid)) + (string-match "/\\([0-9/]+\\)\\(.shtml\\|$\\)" sid) + (setq sid (concat "00/" (match-string 1 sid))) (re-search-forward "\\([^<]+\\)") (setq articles (string-to-number (match-string 1))) (setq gname (concat description " (" sid ")")) @@ -397,9 +398,11 @@ (nnweb-insert (format nnslashdot-active-url number) t) (goto-char (point-min)) (while (re-search-forward - "article.pl\\?sid=\\([^&]+\\).*\\([^<]+\\)" nil t) + "article.pl\\?sid=\\([^&]+\\).*\\([^<]+\\)" + nil t) (setq sid (match-string 1) - description (nnweb-decode-entities-string (match-string 2))) + description + (nnweb-decode-entities-string (match-string 2))) (forward-line 1) (when (re-search-forward "\\([0-9]+\\)" nil t) (setq articles (string-to-number (match-string 1)))) @@ -508,13 +511,15 @@ (format " *nnslashdot %s*" server)))))) (defun nnslashdot-date-to-date (sdate) - (let ((elem (delete "" (split-string sdate)))) - (concat (substring (nth 0 elem) 0 3) " " - (substring (nth 1 elem) 0 3) " " - (substring (nth 2 elem) 0 2) " " - (substring (nth 3 elem) 1 6) " " - (format-time-string "%Y") " " - (nth 4 elem)))) + (condition-case err + (let ((elem (delete "" (split-string sdate)))) + (concat (substring (nth 0 elem) 0 3) " " + (substring (nth 1 elem) 0 3) " " + (substring (nth 2 elem) 0 2) " " + (substring (nth 3 elem) 1 6) " " + (format-time-string "%Y") " " + (nth 4 elem))) + (error ""))) (defun nnslashdot-generate-active () (save-excursion