1 ;;; sb-sponichi.el --- shimbun backend for www.sponichi.co.jp
3 ;; Author: TSUCHIYA Masatoshi <tsuchiya@pine.kuee.kyoto-u.ac.jp>
4 ;; Akihiro Arisawa <ari@atesoft.advantest.co.jp>
5 ;; Yuuichi Teranishi <teranisi@gohome.org>
11 ;; This program is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
16 ;; This program is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with this program; if not, you can either send email to this
23 ;; program's maintainer or write to: The Free Software Foundation,
24 ;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
28 ;; Original code was nnshimbun.el written by
29 ;; TSUCHIYA Masatoshi <tsuchiya@pine.kuee.kyoto-u.ac.jp>.
36 (luna-define-class shimbun-sponichi (shimbun shimbun-text) ())
38 (defvar shimbun-sponichi-url "http://www.sponichi.co.jp/")
39 (defvar shimbun-sponichi-groups '("baseball" "soccer" "usa" "others"
40 "society" "entertainment" "horseracing"))
41 (defvar shimbun-sponichi-coding-system (static-if (boundp 'MULE)
43 (defvar shimbun-sponichi-from-address "webmaster@www.sponichi.co.jp")
44 (defvar shimbun-sponichi-content-start "\n<span class=\"text\">
\e$B!!
\e(B")
45 (defvar shimbun-sponichi-content-end "\n")
47 (luna-define-method shimbun-index-url ((shimbun shimbun-sponichi))
48 (format "%s%s/index.html"
49 (shimbun-url-internal shimbun)
50 (shimbun-current-group-internal shimbun)))
52 (luna-define-method shimbun-get-headers ((shimbun shimbun-sponichi))
53 (when (search-forward "
\e$B%K%e!<%9%$%s%G%C%/%9
\e(B" nil t)
54 (delete-region (point-min) (point))
55 (when (search-forward "
\e$B%"%I%?%0
\e(B" nil t)
57 (delete-region (point) (point-max))
58 (goto-char (point-min))
59 (let ((case-fold-search t)
61 (while (re-search-forward
62 "^<a href=\"/\\(\\([A-z]*\\)/kiji/\\([0-9][0-9][0-9][0-9]\\)/\\([0-9][0-9]\\)/\\([0-9][0-9]\\)/\\([0-9][0-9]\\)\\.html\\)\">"
64 (let ((url (match-string 1))
65 (id (format "<%s%s%s%s%%%s>"
70 (shimbun-current-group-internal shimbun)))
71 (date (shimbun-make-date-string
72 (string-to-number (match-string 3))
73 (string-to-number (match-string 4))
74 (string-to-number (match-string 5)))))
75 (push (shimbun-make-header
77 (shimbun-mime-encode-string
82 (progn (search-forward "<br>" nil t) (point)))
85 (shimbun-from-address-internal shimbun)
86 date id "" 0 0 (concat (shimbun-url-internal shimbun)
91 (provide 'sb-sponichi)
93 ;;; sb-sponichi.el ends here