1 ;;; sb-airs.el --- shimbun backend for lists.airs.net
3 ;; Author: Yuuichi Teranishi <teranisi@gohome.org>
9 ;; This program is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; This program is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details.
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with this program; if not, you can either send email to this
21 ;; program's maintainer or write to: The Free Software Foundation,
22 ;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
26 ;; Original was nnshimbun-airs.el on http://homepage2.nifty.com/strlcat/
32 (luna-define-class shimbun-airs (shimbun-mhonarc) ())
34 (defconst shimbun-airs-group-path-alist
35 '(("semi-gnus-ja" . "semi-gnus/archive")
36 ("wl" . "wl/archive")))
38 (defvar shimbun-airs-url "http://lists.airs.net/")
39 (defvar shimbun-airs-groups (mapcar 'car shimbun-airs-group-path-alist))
40 (defvar shimbun-airs-coding-system (static-if (boundp 'MULE)
41 '*euc-japan* 'euc-jp))
43 (defmacro shimbun-airs-concat-url (shimbun url)
44 (` (concat (shimbun-url-internal (, shimbun))
45 (cdr (assoc (shimbun-current-group-internal (, shimbun))
46 shimbun-airs-group-path-alist))
50 (luna-define-method shimbun-index-url ((shimbun shimbun-airs))
51 (shimbun-airs-concat-url shimbun "index.html"))
53 (luna-define-method shimbun-get-headers ((shimbun shimbun-airs))
54 (let ((case-fold-search t) headers months)
55 (goto-char (point-min))
56 ;; Only first month...
57 (if (re-search-forward "<A HREF=\"\\([0-9]+\\)/\">" nil t)
58 (push (match-string 1) months))
59 (setq months (nreverse months))
60 (dolist (month months)
64 (shimbun-airs-concat-url shimbun (concat month "/index.html"))
67 (goto-char (point-max))
68 (while (re-search-backward
69 "<A[^>]*HREF=\"\\(msg\\([0-9]+\\)\\.html\\)\">\\([^<]+\\)</A>"
71 (setq url (shimbun-airs-concat-url
73 (concat month "/" (match-string 1)))
74 id (format "<%s%05d%%%s>"
76 (string-to-number (match-string 2))
77 (shimbun-current-group-internal shimbun))
78 subject (match-string 3))
80 (goto-char (match-end 0))
81 (push (shimbun-make-header
83 (shimbun-mime-encode-string subject)
84 (if (looking-at "</STRONG> *<EM>\\([^<]+\\)<")
85 (shimbun-mime-encode-string (match-string 1))