/usr/share/emacs/site-lisp/w3m/shimbun/sb-rediff.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 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | ;;; sb-rediff.el --- shimbun backend for rediff.com
;; Copyright (C) 2004, 2005, 2006, 2010 S V N Vishwanathan <vishketan@yahoo.com>
;; Author: S V N Vishwanathan <vishketan@yahoo.com>
;; Keywords: news
;; Created: Nov 22, 2004
;; 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-rediff (shimbun-rss) ())
(defvar shimbun-rediff-url "http://www.rediff.com/rss/newsrss.xml")
(defvar shimbun-rediff-groups '("news"))
(defvar shimbun-rediff-from-address "news@rediff.com")
(defvar shimbun-rediff-content-start "<BR></FONT>")
(defvar shimbun-rediff-content-end
"\\(</P>\\)?</FONT>\\(</FONT>\\)?</TD></TR><TR><TD>")
(defconst shimbun-rediff-month-alist
'(("January" . 1) ("February" . 2) ("March" . 3) ("April" . 4)
("May" . 5) ("June" . 6) ("July" . 7) ("August" . 8)
("September" . 9) ("October" . 10) ("November" . 11) ("December" . 12)))
;; Print version has less ads
(luna-define-method shimbun-article :before
((shimbun shimbun-rediff) header &optional outbuf)
(let ((url (shimbun-article-url shimbun header)))
(unless
(string-match
"http://www.rediff.com/rss/redirect.php\\?url=\
http://www.rediff.com/\\(.+\\.htm\\)"
url)
(error "Malformed URL? %s" url))
(shimbun-header-set-xref
header
(concat
"http://in.rediff.com/cms/print.jsp?docpath="
(match-string-no-properties 1 url)))))
;; Tags to strip from the print version
(luna-define-method shimbun-clear-contents :before
((shimbun shimbun-rediff) header)
(when (luna-call-next-method)
(shimbun-remove-tags "\\(A\\) \\(?:class=\"\"\\|target=new\\)" t)
(shimbun-remove-tags "<P><STRONG>" "</STRONG></A>")
(shimbun-remove-tags "<P><STRONG>Also read:" "</STRONG>\\(</P>\\)?")
(shimbun-remove-tags "<UL[^>]*><LI[^>]*>" "</LI></UL>")
(shimbun-remove-tags
"<TABLE cellSpacing=0 cellPadding=0 width=200 align=left border=0>"
"</TABLE></TD></TR></TABLE>")))
;; The default header has no date string
;; We need to parse it from the contents and set the header
(luna-define-method shimbun-make-contents :before
((shimbun shimbun-rediff) header)
;;; <DEBUG>
;; (shimbun-rediff-make-contents shimbun header))
;;
;;(defun shimbun-rediff-make-contents (shimbun header)
;;; </DEBUG>
(setq case-fold-search nil)
(when (re-search-forward
"\\(January\\|February\\|March\\|April\\|May\\|June\
\\|July\\|August\\|September\\|October\\|November\\|December\\)[ ]+\
\\([0-3][0-9]\\),[ ]+\\(20[0-9][0-9]\\) | \\([0-2][0-9]:[0-6][0-9]\\) IST"
nil t)
(shimbun-header-set-date
header
(shimbun-make-date-string
(string-to-number (match-string-no-properties 3))
(cdr (assoc (match-string-no-properties 1) shimbun-rediff-month-alist))
(string-to-number (match-string-no-properties 2))
(match-string-no-properties 4)
"+05:30"))
(goto-char (point-min))))
(provide 'sb-rediff)
;;; sb-rediff.el ends here
|