1 ;;; sb-yomiuri.el --- shimbun backend for www.yomiuri.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-yomiuri (shimbun shimbun-text) ())
38 (defvar shimbun-yomiuri-url "http://www.yomiuri.co.jp/")
39 (defvar shimbun-yomiuri-groups '("shakai" "sports" "seiji" "keizai"
41 (defvar shimbun-yomiuri-coding-system (static-if (boundp 'MULE)
43 (defvar shimbun-yomiuri-from-address "webmaster@www.yomiuri.co.jp")
44 (defvar shimbun-yomiuri-content-start "\n<!-- honbun start -->\n")
45 (defvar shimbun-yomiuri-content-end "\n<!-- honbun end -->\n")
47 (defvar shimbun-yomiuri-group-path-alist
55 (luna-define-method shimbun-index-url ((shimbun shimbun-yomiuri))
56 (concat (shimbun-url-internal shimbun)
57 (cdr (assoc (shimbun-current-group-internal shimbun)
58 shimbun-yomiuri-group-path-alist))
61 (luna-define-method shimbun-get-headers ((shimbun shimbun-yomiuri))
62 (let ((case-fold-search t)
64 (goto-char (point-min))
65 (when (and (search-forward
66 (format "\n<!-- /news/list start -->\n"
67 (shimbun-current-group-internal shimbun)) nil t)
70 (format "\n<!-- /news/list end -->\n"
71 (shimbun-current-group-internal shimbun)) nil t))
74 (narrow-to-region start (point))
76 (while (re-search-forward
77 "<a href=\"/\\([0-9]+\\)/\\(\\(\\([0-9][0-9][0-9][0-9]\\)\\([0-9][0-9]\\)\\([0-9][0-9]\\)[A-z0-9]+\\)\\.htm\\)\"[^>]*>"
79 (let ((url (concat (match-string 1) "/"
81 (id (format "<%s%s%%%s>"
84 (shimbun-current-group-internal shimbun)))
85 (year (string-to-number (match-string 4)))
86 (month (string-to-number (match-string 5)))
87 (day (string-to-number (match-string 6)))
93 (progn (search-forward "<br>" nil t) (point)))
97 (when (string-match "^
\e$B"!
\e(B" subject)
98 (setq subject (substring subject (match-end 0))))
99 (if (string-match "(\\([0-9][0-9]:[0-9][0-9]\\))$" subject)
100 (setq date (shimbun-make-date-string
101 year month day (match-string 1 subject))
102 subject (substring subject 0 (match-beginning 0)))
103 (setq date (shimbun-make-date-string year month day)))
104 (push (shimbun-make-header
106 (shimbun-mime-encode-string subject)
107 (shimbun-from-address-internal shimbun)
108 date id "" 0 0 (concat
109 (shimbun-url-internal shimbun)
114 (provide 'sb-yomiuri)
116 ;;; sb-yomiuri.el ends here