1 ;;; sb-zdnet.el --- shimbun backend for Zdnet Japan
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>.
34 (luna-define-class shimbun-zdnet (shimbun) ())
36 (defvar shimbun-zdnet-url "http://www.zdnet.co.jp/news/")
37 (defvar shimbun-zdnet-groups '("comp"))
38 (defvar shimbun-zdnet-coding-system (static-if (boundp 'MULE)
40 (defvar shimbun-zdnet-from-address "zdnn@softbank.co.jp")
41 (defvar shimbun-zdnet-content-start "\\(<!--BODY-->\\|<!--DATE-->\\)")
42 (defvar shimbun-zdnet-content-end "\\(<!--BODYEND-->\\|<!--BYLINEEND-->\\)")
44 (luna-define-method shimbun-get-headers ((shimbun shimbun-zdnet))
45 (let ((case-fold-search t) headers)
46 (goto-char (point-min))
48 (while (and (search-forward "<!--" nil t)
49 (setq start (- (point) 4))
50 (search-forward "-->" nil t))
51 (delete-region start (point))))
52 (goto-char (point-min))
53 (while (re-search-forward
54 "<a href=\"\\(/news/\\)?\\(\\([0-9][0-9]\\)\\([0-9][0-9]\\)/\\([0-9][0-9]\\)/\\([^\\.]+\\).html\\)\"><font size=\"4\"><strong>"
56 (let ((year (+ 2000 (string-to-number (match-string 3))))
57 (month (string-to-number (match-string 4)))
58 (day (string-to-number (match-string 5)))
59 (id (format "<%s%s%s%s%%%s>"
64 (shimbun-current-group-internal shimbun)))
65 (url (match-string 2)))
66 (push (shimbun-make-header
68 (shimbun-mime-encode-string
73 (progn (search-forward "</a>" nil t) (point)))
76 (shimbun-from-address-internal shimbun)
77 (shimbun-make-date-string year month day)
78 id "" 0 0 (concat (shimbun-url-internal shimbun) url))
84 ;;; sb-zdnet.el ends here