- ;; First we do the Ultramode to get info on all the latest groups.
- (with-temp-buffer
- (nnweb-insert "http://slashdot.org/slashdot.xml")
- (goto-char (point-min))
- (while (search-forward "<story>" nil t)
- (narrow-to-region (point) (search-forward "</story>"))
- (goto-char (point-min))
- (re-search-forward "<title>\\([^<]+\\)</title>")
- (setq description (match-string 1))
- (re-search-forward "<url>\\([^<]+\\)</url>")
- (setq sid (match-string 1))
- (string-match "/\\([0-9/]+\\).shtml" sid)
- (setq sid (match-string 1 sid))
- (re-search-forward "<comments>\\([^<]+\\)</comments>")
- (setq articles (string-to-number (match-string 1)))
- (setq gname (concat description " (" sid ")"))
- (if (setq elem (assoc gname nnslashdot-groups))
- (setcar (cdr elem) articles)
- (push (list gname articles sid) nnslashdot-groups))
- (goto-char (point-max))
- (widen)))
- ;; Then do the older groups.
- (while (> (- nnslashdot-group-number number) 0)
- (with-temp-buffer
- (let ((case-fold-search t))
- (nnweb-insert (format nnslashdot-active-url number))
- (goto-char (point-min))
- (while (re-search-forward
- "article.pl\\?sid=\\([^&]+\\).*<b>\\([^<]+\\)</b>" nil t)
- (setq sid (match-string 1)
- description (match-string 2))
- (forward-line 1)
- (when (re-search-forward "<b>\\([0-9]+\\)</b>" nil t)
- (setq articles (string-to-number (match-string 1))))
- (setq gname (concat description " (" sid ")"))
- (if (setq elem (assoc gname nnslashdot-groups))
- (setcar (cdr elem) articles)
- (push (list gname articles sid) nnslashdot-groups)))))
- (incf number 30))
+ (condition-case why
+ ;; First we do the Ultramode to get info on all the latest groups.
+ (progn
+ (mm-with-unibyte-buffer
+ (nnweb-insert "http://slashdot.org/slashdot.xml" t)
+ (goto-char (point-min))
+ (while (search-forward "<story>" nil t)
+ (narrow-to-region (point) (search-forward "</story>"))
+ (goto-char (point-min))
+ (re-search-forward "<title>\\([^<]+\\)</title>")
+ (setq description
+ (nnweb-decode-entities-string (match-string 1)))
+ (re-search-forward "<url>\\([^<]+\\)</url>")
+ (setq sid (match-string 1))
+ (string-match "/\\([0-9/]+\\)\\(.shtml\\|$\\)" sid)
+ (setq sid (concat "00/" (match-string 1 sid)))
+ (re-search-forward "<comments>\\([^<]+\\)</comments>")
+ (setq articles (string-to-number (match-string 1)))
+ (setq gname (concat description " (" sid ")"))
+ (if (setq elem (assoc gname nnslashdot-groups))
+ (setcar (cdr elem) articles)
+ (push (list gname articles sid) nnslashdot-groups))
+ (goto-char (point-max))
+ (widen)))
+ ;; Then do the older groups.
+ (while (> (- nnslashdot-group-number number) 0)
+ (mm-with-unibyte-buffer
+ (let ((case-fold-search t))
+ (nnweb-insert (format nnslashdot-active-url number) t)
+ (goto-char (point-min))
+ (while (re-search-forward
+ "article.pl\\?sid=\\([^&]+\\).*<b>\\([^<]+\\)</b>"
+ nil t)
+ (setq sid (match-string 1)
+ description
+ (nnweb-decode-entities-string (match-string 2)))
+ (forward-line 1)
+ (when (re-search-forward "<b>\\([0-9]+\\)</b>" nil t)
+ (setq articles (string-to-number (match-string 1))))
+ (setq gname (concat description " (" sid ")"))
+ (if (setq elem (assoc gname nnslashdot-groups))
+ (setcar (cdr elem) articles)
+ (push (list gname articles sid) nnslashdot-groups)))))
+ (incf number 30)))
+ (search-failed (nnslashdot-lose why)))