1 |
;;; nnultimate.el --- interfacing with the Ultimate Bulletin Board system -*- coding: iso-latin-1 -*- |
;;; nnultimate.el --- interfacing with the Ultimate Bulletin Board system |
2 |
;; Copyright (C) 1999, 2000 Free Software Foundation, Inc. |
|
3 |
|
;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. |
4 |
|
|
5 |
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
6 |
;; Keywords: news |
;; Keywords: news |
37 |
(require 'gnus) |
(require 'gnus) |
38 |
(require 'nnmail) |
(require 'nnmail) |
39 |
(require 'mm-util) |
(require 'mm-util) |
40 |
(eval-when-compile |
(require 'mm-url) |
41 |
(ignore-errors |
(require 'nnweb) |
42 |
(require 'nnweb))) |
(autoload 'w3-parse-buffer "w3-parse") |
|
;; Report failure to find w3 at load time if appropriate. |
|
|
(eval '(require 'nnweb)) |
|
43 |
|
|
44 |
(nnoo-declare nnultimate) |
(nnoo-declare nnultimate) |
45 |
|
|
106 |
fetchers)) |
fetchers)) |
107 |
(pop articles) |
(pop articles) |
108 |
(setq article (car articles))))) |
(setq article (car articles))))) |
109 |
;; Now we have the mapping from/to Gnus/nnultimate article numbers, |
;; Now we have the mapping from/to Gnus/nnultimate article numbers, |
110 |
;; so we start fetching the topics that we need to satisfy the |
;; so we start fetching the topics that we need to satisfy the |
111 |
;; request. |
;; request. |
112 |
(if (not fetchers) |
(if (not fetchers) |
124 |
(setq subject (nth 2 (assq (car elem) topics))) |
(setq subject (nth 2 (assq (car elem) topics))) |
125 |
(setq href (nth 3 (assq (car elem) topics))) |
(setq href (nth 3 (assq (car elem) topics))) |
126 |
(if (= current-page 1) |
(if (= current-page 1) |
127 |
(nnweb-insert href) |
(mm-url-insert href) |
128 |
(string-match "\\.html$" href) |
(string-match "\\.html$" href) |
129 |
(nnweb-insert (concat (substring href 0 (match-beginning 0)) |
(mm-url-insert (concat (substring href 0 (match-beginning 0)) |
130 |
"-" (number-to-string current-page) |
"-" (number-to-string current-page) |
131 |
(match-string 0 href)))) |
(match-string 0 href)))) |
132 |
(goto-char (point-min)) |
(goto-char (point-min)) |
172 |
datel nil)) |
datel nil)) |
173 |
(pop datel)) |
(pop datel)) |
174 |
(when date |
(when date |
175 |
(setq date (delete "" (split-string |
(setq date (delete "" (split-string date "[-, \n\t\r ]"))) |
176 |
date "[-, \n\t\r ]"))) |
(setq date |
177 |
(if (or (member "AM" date) |
(if (or (member "AM" date) |
178 |
(member "PM" date)) |
(member "PM" date)) |
179 |
(setq date (format |
(format |
180 |
"%s %s %s %s" |
"%s %s %s %s" |
181 |
(nth 1 date) |
(nth 1 date) |
182 |
(if (and (>= (length (nth 0 date)) 3) |
(if (and (>= (length (nth 0 date)) 3) |
183 |
(assoc (downcase |
(assoc (downcase |
184 |
(substring (nth 0 date) 0 3)) |
(substring (nth 0 date) 0 3)) |
185 |
parse-time-months)) |
parse-time-months)) |
186 |
(substring (nth 0 date) 0 3) |
(substring (nth 0 date) 0 3) |
187 |
(car (rassq (string-to-number (nth 0 date)) |
(car (rassq (string-to-number (nth 0 date)) |
188 |
parse-time-months))) |
parse-time-months))) |
189 |
(nth 2 date) (nth 3 date))) |
(nth 2 date) (nth 3 date)) |
190 |
(setq date (format "%s %s %s %s" |
(format "%s %s %s %s" |
191 |
(car (rassq (string-to-number (nth 1 date)) |
(car (rassq (string-to-number (nth 1 date)) |
192 |
parse-time-months)) |
parse-time-months)) |
193 |
(nth 0 date) (nth 2 date) (nth 3 date))))) |
(nth 0 date) (nth 2 date) (nth 3 date))))) |
194 |
(push |
(push |
195 |
(cons |
(cons |
196 |
article |
article |
268 |
(deffoo nnultimate-request-list (&optional server) |
(deffoo nnultimate-request-list (&optional server) |
269 |
(nnultimate-possibly-change-server nil server) |
(nnultimate-possibly-change-server nil server) |
270 |
(mm-with-unibyte-buffer |
(mm-with-unibyte-buffer |
271 |
(nnweb-insert |
(mm-url-insert |
272 |
(if (string-match "/$" nnultimate-address) |
(if (string-match "/$" nnultimate-address) |
273 |
(concat nnultimate-address "Ultimate.cgi") |
(concat nnultimate-address "Ultimate.cgi") |
274 |
nnultimate-address)) |
nnultimate-address)) |
333 |
(mm-with-unibyte-buffer |
(mm-with-unibyte-buffer |
334 |
(while furls |
(while furls |
335 |
(erase-buffer) |
(erase-buffer) |
336 |
(nnweb-insert (pop furls)) |
(mm-url-insert (pop furls)) |
337 |
(goto-char (point-min)) |
(goto-char (point-min)) |
338 |
(setq parse (w3-parse-buffer (current-buffer))) |
(setq parse (w3-parse-buffer (current-buffer))) |
339 |
(setq contents |
(setq contents |