/usr/share/emacs/site-lisp/w3m/shimbun/sb-emacswiki.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-emacswiki.el --- emacswiki shimbun backend
;; Copyright (C) 2004, 2005 David Hansen
;; Author: David Hansen <david.hansen@physik.fu-berlin.de>
;; Keywords: news
;; This file is a part of shimbun.
;; This 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 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 GNU Emacs; 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-emacswiki (shimbun-rss) ())
(defvar shimbun-emacswiki-url
"http://www.emacswiki.org/cgi-bin/wiki.pl?action=rss")
(defvar shimbun-emacswiki-groups '("changes" "diff"))
(defvar shimbun-emacswiki-from-address "invalid@emacswiki.org")
(defvar shimbun-emacswiki-content-start "<h1>")
(defvar shimbun-emacswiki-content-end "<div class=\"footer\">")
(defvar shimbun-emacswiki-x-face-alist
'(("default" . "X-Face: 'Is?R.u_yTmkkPe(`Zyec$CF<xHX/m-bK|ROSqoD|DDW6;z&\
/T$@b=k:F#n>ri1KJ)/XVXzJ~!dA'H{,F+;f-IaJ$2~S9ZU6U@_\"%*YzLz8kAxsX3(q`>a&zos\
\\9.[2/gpE76Fim]r7o7hz&@@O#d{`BXdD)i]DQBW,Z]#$5YWYNT}@Y{cm}O}ev`l`QAeZI*NN<\
e2ibWOZWTFz8j~/m")))
(luna-define-method shimbun-index-url ((shimbun shimbun-emacswiki))
shimbun-emacswiki-url)
(luna-define-method shimbun-get-headers :around ((shimbun shimbun-emacswiki)
&optional range)
(static-when (featurep 'xemacs)
;; It's one of many bugs in XEmacs that the coding systems *-dos
;; provided by Mule-UCS don't convert CRLF to LF when decoding.
(shimbun-strip-cr))
(let ((xml (condition-case err
(xml-parse-region (point-min) (point-max))
(error
(message "Error while parsing %s: %s"
(shimbun-index-url shimbun)
(error-message-string err))
nil)))
dc-ns rss-ns wiki-ns url headers)
(when xml
(setq dc-ns (shimbun-rss-get-namespace-prefix
xml "http://purl.org/dc/elements/1.1/")
rss-ns (shimbun-rss-get-namespace-prefix
xml "http://purl.org/rss/1.0/")
wiki-ns (shimbun-rss-get-namespace-prefix
xml "http://purl.org/rss/1.0/modules/wiki/"))
(dolist (item (shimbun-rss-find-el (intern (concat rss-ns "item")) xml)
headers)
(setq url (and (listp item)
(eq (intern (concat rss-ns "item")) (car item))
(if (string= (shimbun-current-group shimbun) "changes")
(shimbun-rss-node-text rss-ns 'link item)
(shimbun-rss-node-text wiki-ns 'diff item))))
(when url
(let* ((date (or (shimbun-rss-node-text dc-ns 'date item)
(shimbun-rss-node-text rss-ns 'pubDate item)))
(id (shimbun-rss-build-message-id shimbun url date)))
(unless (shimbun-search-id shimbun id)
(push (shimbun-create-header
0
(let ((desc (shimbun-rss-node-text rss-ns 'description
item)))
(concat (shimbun-rss-node-text rss-ns 'title item)
(if desc
(concat " - " desc))))
(or (shimbun-rss-node-text wiki-ns 'username item)
(shimbun-from-address shimbun))
(shimbun-rss-process-date shimbun date)
id "" 0 0 url)
headers))))))))
(luna-define-method shimbun-rss-build-message-id
((shimbun shimbun-emacswiki) url date)
(unless (or (string-match "id=\\(.+\\)$" url)
(string-match "/\\([^/]+\\)$" url))
(error "Cannot find message-id base"))
(concat "<" (match-string 1 url) date "@emacswiki.org>"))
(provide 'sb-emacswiki)
;;; sb-emacswiki.el ends here
|