Mercurial > emacs
comparison lisp/gnus/nnultimate.el @ 89971:cce1c0ee76ee
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-36
Merge from emacs--cvs-trunk--0, emacs--gnus--5.10, gnus--rel--5.10
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Merge from emacs--gnus--5.10, gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-524
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-534
Update from CVS
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--base-0
tag of miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-464
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-1
Import from CVS branch gnus-5_10-branch
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-2
Merge from lorentey@elte.hu--2004/emacs--multi-tty--0, emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-3
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-4
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-18
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-19
Remove autoconf-generated files from archive
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-20
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Thu, 09 Sep 2004 09:36:36 +0000 |
parents | 561b856c5b1f 55fd4f77387a |
children | 02f1dbc4a199 |
comparison
equal
deleted
inserted
replaced
89970:a849e5779b8c | 89971:cce1c0ee76ee |
---|---|
1 ;;; nnultimate.el --- interfacing with the Ultimate Bulletin Board system -*- coding: iso-latin-1 -*- | 1 ;;; nnultimate.el --- interfacing with the Ultimate Bulletin Board system |
2 ;; Copyright (C) 1999, 2000 Free Software Foundation, Inc. | 2 |
3 ;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. | |
3 | 4 |
4 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> | 5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
5 ;; Keywords: news | 6 ;; Keywords: news |
6 | 7 |
7 ;; This file is part of GNU Emacs. | 8 ;; This file is part of GNU Emacs. |
34 (require 'message) | 35 (require 'message) |
35 (require 'gnus-util) | 36 (require 'gnus-util) |
36 (require 'gnus) | 37 (require 'gnus) |
37 (require 'nnmail) | 38 (require 'nnmail) |
38 (require 'mm-util) | 39 (require 'mm-util) |
39 (eval-when-compile | 40 (require 'mm-url) |
40 (ignore-errors | 41 (require 'nnweb) |
41 (require 'nnweb))) | 42 (autoload 'w3-parse-buffer "w3-parse") |
42 ;; Report failure to find w3 at load time if appropriate. | |
43 (eval '(require 'nnweb)) | |
44 | 43 |
45 (nnoo-declare nnultimate) | 44 (nnoo-declare nnultimate) |
46 | 45 |
47 (defvoo nnultimate-directory (nnheader-concat gnus-directory "ultimate/") | 46 (defvoo nnultimate-directory (nnheader-concat gnus-directory "ultimate/") |
48 "Where nnultimate will save its files.") | 47 "Where nnultimate will save its files.") |
105 (cons article | 104 (cons article |
106 (+ (nth 3 mmap) (incf farticle)))) | 105 (+ (nth 3 mmap) (incf farticle)))) |
107 fetchers)) | 106 fetchers)) |
108 (pop articles) | 107 (pop articles) |
109 (setq article (car articles))))) | 108 (setq article (car articles))))) |
110 ;; Now we have the mapping from/to Gnus/nnultimate article numbers, | 109 ;; Now we have the mapping from/to Gnus/nnultimate article numbers, |
111 ;; so we start fetching the topics that we need to satisfy the | 110 ;; so we start fetching the topics that we need to satisfy the |
112 ;; request. | 111 ;; request. |
113 (if (not fetchers) | 112 (if (not fetchers) |
114 (save-excursion | 113 (save-excursion |
115 (set-buffer nntp-server-buffer) | 114 (set-buffer nntp-server-buffer) |
123 (while (<= current-page pages) | 122 (while (<= current-page pages) |
124 (erase-buffer) | 123 (erase-buffer) |
125 (setq subject (nth 2 (assq (car elem) topics))) | 124 (setq subject (nth 2 (assq (car elem) topics))) |
126 (setq href (nth 3 (assq (car elem) topics))) | 125 (setq href (nth 3 (assq (car elem) topics))) |
127 (if (= current-page 1) | 126 (if (= current-page 1) |
128 (nnweb-insert href) | 127 (mm-url-insert href) |
129 (string-match "\\.html$" href) | 128 (string-match "\\.html$" href) |
130 (nnweb-insert (concat (substring href 0 (match-beginning 0)) | 129 (mm-url-insert (concat (substring href 0 (match-beginning 0)) |
131 "-" (number-to-string current-page) | 130 "-" (number-to-string current-page) |
132 (match-string 0 href)))) | 131 (match-string 0 href)))) |
133 (goto-char (point-min)) | 132 (goto-char (point-min)) |
134 (setq contents | 133 (setq contents |
135 (ignore-errors (w3-parse-buffer (current-buffer)))) | 134 (ignore-errors (w3-parse-buffer (current-buffer)))) |
171 (when (string-match "Posted" (car datel)) | 170 (when (string-match "Posted" (car datel)) |
172 (setq date (substring (car datel) (match-end 0)) | 171 (setq date (substring (car datel) (match-end 0)) |
173 datel nil)) | 172 datel nil)) |
174 (pop datel)) | 173 (pop datel)) |
175 (when date | 174 (when date |
176 (setq date (delete "" (split-string | 175 (setq date (delete "" (split-string date "[-, \n\t\r ]"))) |
177 date "[-, \n\t\r ]"))) | 176 (setq date |
178 (if (or (member "AM" date) | 177 (if (or (member "AM" date) |
179 (member "PM" date)) | 178 (member "PM" date)) |
180 (setq date (format | 179 (format |
181 "%s %s %s %s" | 180 "%s %s %s %s" |
182 (nth 1 date) | 181 (nth 1 date) |
183 (if (and (>= (length (nth 0 date)) 3) | 182 (if (and (>= (length (nth 0 date)) 3) |
184 (assoc (downcase | 183 (assoc (downcase |
185 (substring (nth 0 date) 0 3)) | 184 (substring (nth 0 date) 0 3)) |
186 parse-time-months)) | 185 parse-time-months)) |
187 (substring (nth 0 date) 0 3) | 186 (substring (nth 0 date) 0 3) |
188 (car (rassq (string-to-number (nth 0 date)) | 187 (car (rassq (string-to-number (nth 0 date)) |
189 parse-time-months))) | 188 parse-time-months))) |
190 (nth 2 date) (nth 3 date))) | 189 (nth 2 date) (nth 3 date)) |
191 (setq date (format "%s %s %s %s" | 190 (format "%s %s %s %s" |
192 (car (rassq (string-to-number (nth 1 date)) | 191 (car (rassq (string-to-number (nth 1 date)) |
193 parse-time-months)) | 192 parse-time-months)) |
194 (nth 0 date) (nth 2 date) (nth 3 date))))) | 193 (nth 0 date) (nth 2 date) (nth 3 date))))) |
195 (push | 194 (push |
196 (cons | 195 (cons |
197 article | 196 article |
198 (make-full-mail-header | 197 (make-full-mail-header |
199 article subject | 198 article subject |
267 (cons group article))))) | 266 (cons group article))))) |
268 | 267 |
269 (deffoo nnultimate-request-list (&optional server) | 268 (deffoo nnultimate-request-list (&optional server) |
270 (nnultimate-possibly-change-server nil server) | 269 (nnultimate-possibly-change-server nil server) |
271 (mm-with-unibyte-buffer | 270 (mm-with-unibyte-buffer |
272 (nnweb-insert | 271 (mm-url-insert |
273 (if (string-match "/$" nnultimate-address) | 272 (if (string-match "/$" nnultimate-address) |
274 (concat nnultimate-address "Ultimate.cgi") | 273 (concat nnultimate-address "Ultimate.cgi") |
275 nnultimate-address)) | 274 nnultimate-address)) |
276 (let ((contents (nth 2 (car (nth 2 | 275 (let ((contents (nth 2 (car (nth 2 |
277 (nnultimate-find-forum-table | 276 (nnultimate-find-forum-table |
332 contents forum-contents furl-fetched a subject href | 331 contents forum-contents furl-fetched a subject href |
333 garticles topic tinfo old-max inc parse) | 332 garticles topic tinfo old-max inc parse) |
334 (mm-with-unibyte-buffer | 333 (mm-with-unibyte-buffer |
335 (while furls | 334 (while furls |
336 (erase-buffer) | 335 (erase-buffer) |
337 (nnweb-insert (pop furls)) | 336 (mm-url-insert (pop furls)) |
338 (goto-char (point-min)) | 337 (goto-char (point-min)) |
339 (setq parse (w3-parse-buffer (current-buffer))) | 338 (setq parse (w3-parse-buffer (current-buffer))) |
340 (setq contents | 339 (setq contents |
341 (cdr (nth 2 (car (nth 2 (nnultimate-find-forum-table | 340 (cdr (nth 2 (car (nth 2 (nnultimate-find-forum-table |
342 parse)))))) | 341 parse)))))) |