1 ;;; sb-cnet.el --- shimbun backend for cnet
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>.
35 (luna-define-class shimbun-cnet (shimbun) ())
37 (defvar shimbun-cnet-url "http://cnet.sphere.ne.jp/")
38 (defvar shimbun-cnet-groups '("comp"))
39 (defvar shimbun-cnet-coding-system (static-if (boundp 'MULE)
41 (defvar shimbun-cnet-from-address "cnet@sphere.ad.jp")
42 (defvar shimbun-cnet-content-start "\n<!--KIJI-->\n")
43 (defvar shimbun-cnet-content-end "\n<!--/KIJI-->\n")
45 (luna-define-method shimbun-index-url ((shimbun shimbun-cnet))
46 (format "%s/News/Oneweek/" (shimbun-url-internal shimbun)))
48 (luna-define-method shimbun-get-headers ((shimbun shimbun-cnet))
49 (let ((case-fold-search t) headers)
50 (while (search-forward "\n<!--*****
\e$B8+=P$7
\e(B*****-->\n" nil t)
51 (let ((subject (buffer-substring (point) (point-at-eol)))
54 (when (looking-at "<a href=\"/\\(News/\\([0-9][0-9][0-9][0-9]\\)/Item/\\([0-9][0-9]\\([0-9][0-9]\\)\\([0-9][0-9]\\)-[0-9]+\\).html\\)\">")
55 (let ((url (match-string 1))
56 (id (format "<%s%s%%%s>"
59 (shimbun-current-group-internal shimbun)))
60 (date (shimbun-make-date-string
61 (string-to-number (match-string 2))
62 (string-to-number (match-string 4))
63 (string-to-number (match-string 5)))))
64 (push (shimbun-make-header
66 (shimbun-mime-encode-string subject)
67 (shimbun-from-address-internal shimbun)
68 date id "" 0 0 (concat (shimbun-url-internal shimbun) url))
75 ;;; sb-cnet.el ends here