- (dolist (header nnslashdot-headers)
- (nnheader-insert-nov (cdr header))))
- 'nov))
-
-(deffoo nnslashdot-sane-retrieve-headers (articles group)
- (let ((last (car (last articles)))
- (did nil)
- (start (max (1- (car articles)) 1))
- (sid (caddr (assoc group nnslashdot-groups)))
- headers article subject score from date lines parent point)
- (save-excursion
- (set-buffer nnslashdot-buffer)
- (erase-buffer)
- (when (= start 1)
- (nnweb-insert (format nnslashdot-article-url
- (nnslashdot-sid-strip sid)) t)
- (goto-char (point-min))
- (search-forward "Posted by ")
- (when (looking-at "<a[^>]+>\\([^<]+\\)")
- (setq from (nnweb-decode-entities-string (match-string 1))))
- (search-forward " on ")
- (setq date (nnslashdot-date-to-date
- (buffer-substring (point) (1- (search-forward "<")))))
- (forward-line 2)
- (setq lines (count-lines (point)
- (search-forward
- "A href=\"/article")))
- (push
- (cons
- 1
- (make-full-mail-header
- 1 group from date (concat "<" (nnslashdot-sid-strip sid)
- "%1@slashdot>")
- "" 0 lines nil nil))
- headers))
- (while (or (not article)
- (and did
- (< article last)))
- (when article
- (setq start (1+ article)))
- (setq point (goto-char (point-max)))
- (nnweb-insert
- (format nnslashdot-comments-url (nnslashdot-sid-strip sid)
- nnslashdot-threshold 4 start)
- t)
- (goto-char point)
- (while (re-search-forward
- "<a name=\"\\([0-9]+\\)\"><\\(b\\|H4\\)>\\([^<]+\\)</\\(b\\|H4\\)>.*score:\\([^)]+\\))"
- nil t)
- (setq article (string-to-number (match-string 1))
- subject (match-string 3)
- score (match-string 5))
- (when (string-match "^Re: *" subject)
- (setq subject (concat "Re: " (substring subject (match-end 0)))))
- (setq subject (nnweb-decode-entities-string subject))
- (forward-line 1)
- (if (looking-at
- "by <a[^>]+>\\([^<]+\\)</a>[ \t\n]*.*(\\([^)]+\\))")
- (setq from (concat (nnweb-decode-entities-string (match-string 1))
- " <" (match-string 2) ">"))
- (looking-at "by \\(.+\\) on ")
- (setq from (nnweb-decode-entities-string (match-string 1))))
- (goto-char (- (match-end 0) 5))
- (search-forward " on ")
- (setq date
- (nnslashdot-date-to-date
- (buffer-substring (point) (progn (end-of-line) (point)))))
- (setq lines (/ (abs (- (search-forward "<td ")
- (search-forward "</td>")))
- 70))
- (forward-line 2)
- (setq parent
- (if (looking-at ".*cid=\\([0-9]+\\)")
- (match-string 1)
- nil))
- (setq did t)
- (push
- (cons
- (1+ article)
- (make-full-mail-header
- (1+ article) (concat subject " (" score ")")
- from date
- (concat "<" (nnslashdot-sid-strip sid) "%"
- (number-to-string (1+ article))
- "@slashdot>")
- (if parent
- (concat "<" (nnslashdot-sid-strip sid) "%"
- (number-to-string (1+ (string-to-number parent)))
- "@slashdot>")
- "")
- 0 lines nil nil))
- headers))))
- (setq nnslashdot-headers
- (sort headers (lambda (s1 s2) (< (car s1) (car s2)))))
- (save-excursion
- (set-buffer nntp-server-buffer)
- (erase-buffer)
- (dolist (header nnslashdot-headers)
- (nnheader-insert-nov (cdr header))))