/usr/share/emacs/site-lisp/w3m/shimbun/sb-rakuten.el is in w3m-el 1.4.483+0.20120614-8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | ;;; sb-rakuten.el --- shimbun backend for rakuten diary -*- coding: iso-2022-7bit; -*-
;; Copyright (C) 2003, 2004, 2006 NAKAJIMA Mikio <minakaji@namazu.org>
;; Author: NAKAJIMA Mikio <minakaji@namazu.org>
;; Keywords: news
;; Created: Nov 1, 2003
;; This file is a part of shimbun.
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Commentary:
;;; Code:
(require 'shimbun)
(require 'sb-rss)
(luna-define-class shimbun-rakuten (shimbun-rss) ())
(defcustom shimbun-rakuten-group-alist
nil ;; '((rakuten-id . email-address))
"*List of subscribing diaries served by Rakuten."
:group 'shimbun
:type '(repeat (cons
:format "%v" :indent 2
(string :tag "Rakuten ID")
(string :tag "Mail address"))))
(defvar shimbun-rakuten-coding-system 'euc-japan)
(defvar shimbun-rakuten-content-start
;;"^<img src=\"\/img\/face\/[0-9]\\.gif.+</table>"
"^</table>\n+<center>")
(defvar shimbun-rakuten-content-end "^<\\/body>")
(luna-define-method shimbun-reply-to ((shimbun shimbun-rakuten))
(cdr (assoc (shimbun-current-group-internal shimbun)
shimbun-rakuten-group-alist)))
(luna-define-method shimbun-groups ((shimbun shimbun-rakuten))
(mapcar 'car shimbun-rakuten-group-alist))
(luna-define-method shimbun-index-url ((shimbun shimbun-rakuten))
(format "http://api.plaza.rakuten.ne.jp/%s/rss/"
(shimbun-current-group-internal shimbun)))
(luna-define-method shimbun-rss-get-date
((shimbun shimbun-rakuten) url)
(unless (string-match
"http://[^\/]+/[^\/]+/[^\/]+/\\([0-9]+\\)-\\([0-9]+\\)-\\([0-9]+\\)"
url)
(error "Cannot find a date base"))
(shimbun-make-date-string
(string-to-number (match-string-no-properties 1 url))
(string-to-number (match-string-no-properties 2 url))
(string-to-number (match-string-no-properties 3 url))))
(luna-define-method shimbun-rss-process-date
((shimbun shimbun-rakuten) date)
date)
(luna-define-method shimbun-make-contents :before
((shimbun shimbun-rakuten) header)
(save-excursion
(let ((string
(format
">$B46A[$r=q$/(B</a>$B("(B\
<a href=\"http://plaza.rakuten.co.jp/%s/bbs/\">$B7G<(HD$X(B</a>$B("(B"
(shimbun-current-group-internal shimbun))))
(subst-char-in-region (point-min) (point-max) ?\t ?\ t)
(while (re-search-forward ">$B46A[$r=q$/(B<\\/a>$B("(B" nil t nil)
(replace-match string)))))
(provide 'sb-rakuten)
;;; sb-rakuten.el ends here
|