/[emacs]/emacs/lisp/gnus/nnslashdot.el
ViewVC logotype

Diff of /emacs/lisp/gnus/nnslashdot.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by ttn, Sat Aug 6 19:51:42 2005 UTC revision 1.9 by miles, Tue Oct 25 23:34:40 2005 UTC
# Line 87  Line 87 
87    (nnslashdot-possibly-change-server group server)    (nnslashdot-possibly-change-server group server)
88    (condition-case why    (condition-case why
89        (unless gnus-nov-is-evil        (unless gnus-nov-is-evil
90          (nnslashdot-retrieve-headers-1 articles group))          (nnslashdot-retrieve-headers-1 articles group))
91      (search-failed (nnslashdot-lose why))))      (search-failed (nnslashdot-lose why))))
92    
93  (deffoo nnslashdot-retrieve-headers-1 (articles group)  (deffoo nnslashdot-retrieve-headers-1 (articles group)
# Line 142  Line 142 
142            (setq article (if (and article (< start article)) article start))            (setq article (if (and article (< start article)) article start))
143            (goto-char point)            (goto-char point)
144            (while (re-search-forward            (while (re-search-forward
145                    "<a name=\"\\([0-9]+\\)\"><\\(b\\|H4\\)>\\([^<]+\\)</\\(b\\|H4\\)>.*score:\\([^)]+\\))"                    "<a name=\"\\([0-9]+\\)\">\\([^<]+\\)</a>.*\n.*score:\\([^)]+\\))"
146                    nil t)                    nil t)
147              (setq cid (match-string 1)              (setq cid (match-string 1)
148                    subject (match-string 3)                    subject (match-string 2)
149                    score (match-string 5))                    score (match-string 3))
150              (unless (assq article (nth 4 entry))              (unless (assq article (nth 4 entry))
151                (setcar (nthcdr 4 entry) (cons (cons article cid) (nth 4 entry)))                (setcar (nthcdr 4 entry) (cons (cons article cid) (nth 4 entry)))
152                (setq changed t))                (setq changed t))
153              (when (string-match "^Re: *" subject)              (when (string-match "^Re: *" subject)
154                (setq subject (concat "Re: " (substring subject (match-end 0)))))                (setq subject (concat "Re: " (substring subject (match-end 0)))))
155              (setq subject (mm-url-decode-entities-string subject))              (setq subject (mm-url-decode-entities-string subject)
156              (search-forward "<BR>")                    from "")
157              (cond              (when (re-search-forward "by[ \t\n]+<[^>]+>\\([^<(]+\\)" nil t)
158               ((looking-at                (setq from
159                 "by[ \t\n]+<a[^>]+>\\([^<]+\\)</a>[ \t\n]*(\\(<[^>]+>\\)*\\([^<>)]+\\))")                      (concat
160                (goto-char (- (match-end 0) 5))                       (mm-url-decode-entities-string (match-string 1))
161                (setq from (concat                       " <nobody@slashdot.org>")))
                           (mm-url-decode-entities-string (match-string 1))  
                           " <" (match-string 3) ">")))  
              ((looking-at "by[ \t\n]+<a[^>]+>\\([^<(]+\\) (\\([0-9]+\\))</a>")  
               (goto-char (- (match-end 0) 5))  
               (setq from (concat  
                           (mm-url-decode-entities-string (match-string 1))  
                           " <" (match-string 2) ">")))  
              ((looking-at "by \\([^<>]*\\)[\t\n\r ]+on ")  
               (goto-char (- (match-end 0) 5))  
               (setq from (mm-url-decode-entities-string (match-string 1))))  
              (t  
               (setq from "")))  
162              (search-forward "on ")              (search-forward "on ")
163              (setq date              (setq date
164                    (nnslashdot-date-to-date                    (nnslashdot-date-to-date
165                     (buffer-substring (point) (progn (skip-chars-forward "^()<>\n\r") (point)))))                     (buffer-substring
166              (setq lines (/ (abs (- (search-forward "<td")                      (point) (progn (skip-chars-forward "^()<>\n\r") (point)))))
167                                     (search-forward "</td>")))              (setq lines (/ (abs (- (search-forward "<div")
168                                       (search-forward "</div>")))
169                             70))                             70))
170              (if (not              (if (not
171                   (re-search-forward ".*cid=\\([0-9]+\\)\">Parent</A>" nil t))                   (re-search-forward ".*cid=\\([0-9]+\\)\">Parent</A>" nil t))
# Line 255  Line 244 
244              (when (numberp article)              (when (numberp article)
245                (if (= article 1)                (if (= article 1)
246                    (progn                    (progn
247                      (re-search-forward                      (search-forward "Posted by")
248                       "Posted by")                      (search-forward "<div class=\"intro\">")
                     (search-forward "<BR>")  
249                      (setq contents                      (setq contents
250                            (buffer-substring                            (buffer-substring
251                             (point)                             (point)
252                             (progn                             (progn
253                               (re-search-forward                               (search-forward "commentwrap")
                               "<IFRAME\\|<SCRIPT LANGUAGE=\"JAVASCRIPT\">\\|<!-- no ad 6 -->\\|&lt;&nbsp;[ \t\r\n]*<A HREF=\"\\(\\(http:\\)?//slashdot\\.org\\)?/article")  
254                               (match-beginning 0)))))                               (match-beginning 0)))))
255                  (setq cid (cdr (assq article                  (setq cid (cdr (assq article
256                                       (nth 4 (assoc group nnslashdot-groups)))))                                       (nth 4 (assoc group nnslashdot-groups)))))
257                  (search-forward (format "<a name=\"%s\">" cid))                  (search-forward (format "<a name=\"%s\">" cid))
258                  (setq contents                  (setq contents
259                        (buffer-substring                        (buffer-substring
260                         (re-search-forward "<td[^>]*>")                         (search-forward "<div class=\"commentBody\">")
261                         (search-forward "</td>")))))))                         (search-forward "</div>")))))))
262        (search-failed (nnslashdot-lose why)))        (search-failed (nnslashdot-lose why)))
263    
264      (when contents      (when contents

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26