This file is indexed.

/usr/share/emacs/site-lisp/w3m/shimbun/sb-cnet-jp.el is in w3m-el-snapshot 1.4.569+0.20170110-1.

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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
;;; sb-cnet-jp.el --- shimbun backend for CNET Japan -*- coding: iso-2022-7bit -*-

;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010
;; NAKAJIMA Mikio <minakaji@namazu.org>

;; Author: NAKAJIMA Mikio     <minakaji@namazu.org>,
;;         TSUCHIYA Masatoshi <tsuchiya@namazu.org>,
;;         Katsumi Yamaoka    <yamaoka@jpl.org>,
;;         Tsuyoshi CHO       <tsuyoshi_cho@ybb.ne.jp>
;; Keywords: news
;; Created: Jun 14, 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-multi)
(require 'sb-rss)

(luna-define-class shimbun-cnet-jp (shimbun-multi shimbun-rss) ())

(defvar shimbun-cnet-jp-group-alist
  '(("general" . "http://feed.japan.cnet.com/rss/index.rdf")
    ("news" . "http://feed.japan.cnet.com/rss/news/index.rdf")
    ;;("release" . "http://release.japan.cnet.com/rss/index.rdf")
    ("special" . "http://feed.japan.cnet.com/rss/sp/index.rdf")
    ("opinion" . "http://feed.japan.cnet.com/rss/opinion/index.rdf")
    ;;("whitepaper" . "http://paper.japan.cnet.com/rss/index.rdf")
    ;;("review" . "http://review.japan.cnet.com/rss/index.rdf")
    ("blog.geetstate" . "http://blog.japan.cnet.com/geetstate/index.rdf")
    ("blog.kenn" . "http://blog.japan.cnet.com/kenn/index.rdf")
    ("blog.lessig" . "http://blog.japan.cnet.com/lessig/index.rdf")
    ("blog.matsumura" . "http://blog.japan.cnet.com/matsumura/index.rdf")
    ("blog.nakajima" . "http://blog.japan.cnet.com/nakajima/index.rdf")
    ("blog.saeki" . "http://blog.japan.cnet.com/saeki/index.rdf")
    ("blog.sakamoto" . "http://blog.japan.cnet.com/sakamoto/index.rdf")
    ("blog.sasaki" . "http://blog.japan.cnet.com/sasaki/index.rdf")
    ("blog.sentan" . "http://blog.japan.cnet.com/sentan/index.rdf")
    ("blog.staff" . "http://blog.japan.cnet.com/staff/index.rdf")
    ("blog.takawata" . "http://blog.japan.cnet.com/takawata/index.rdf")
    ("blog.watanabe" . "http://blog.japan.cnet.com/watanabe/index.rdf")))

(defvar shimbun-cnet-jp-orphaned-group-list
  '("blog.inoue"
    "blog.mori"
    "blog.umeda"
    "blog.editors"))

(defvar shimbun-cnet-jp-server-name "CNET Networks,Inc.")
(defvar shimbun-cnet-jp-content-start
  "<div class=\"\\(?:leaf\\|article\\)_body\\(?: \\(?:article\\|leaf\\)_body\\)?\">")
(defvar shimbun-cnet-jp-content-end
  "\\(<div \\(class=\"article_footer\"\\|id=\"bubble_tooltip\"\\)>\\|\
<!--h3>$B%H%i%C%/%P%C%/0lMw(B</h3-->\\)")
(defvar shimbun-cnet-jp-x-face-alist
  '(("default" . "X-Face: 0p7.+XId>z%:!$ahe?x%+AEm37Abvn]n\
*GGh+>v=;[3`a{1lqO[$,~3C3xU_ri>[JwJ!9l0\n ~Y`b*eXAQ:*q=bBI\
_=ro*?]4:|n>]ZiLZ2LEo^2nr('C<+`lO~/!R[lH'N'4X&%\\I}8T!wt")))

(luna-define-method shimbun-groups ((shimbun shimbun-cnet-jp))
  (nconc (mapcar 'car shimbun-cnet-jp-group-alist)
	 shimbun-cnet-jp-orphaned-group-list))

(luna-define-method shimbun-headers :around ((shimbun shimbun-cnet-jp)
					     &optional range)
  (unless (member (shimbun-current-group shimbun)
		  shimbun-cnet-jp-orphaned-group-list)
    (luna-call-next-method)))

(luna-define-method shimbun-index-url ((shimbun shimbun-cnet-jp))
  (cdr (assoc (shimbun-current-group shimbun) shimbun-cnet-jp-group-alist)))

(luna-define-method shimbun-multi-next-url ((shimbun shimbun-cnet-jp)
					    header url)
  (goto-char (point-min))
  (when (re-search-forward "<li class=\"next\"><a href=\"\\([^\"]+\\)\"" nil t)
    (shimbun-expand-url (match-string 1) url)))

(luna-define-method shimbun-clear-contents :before ((shimbun shimbun-cnet-jp)
						    header)
  (shimbun-strip-cr)
  (shimbun-remove-tags "script\\|noscript" t)
  (shimbun-remove-tags
   "\\(div\\) class=\"\\(?:photor_thumb_wrap\\|block_infocnet_stb\\)\"" t)
  (shimbun-remove-tags "<div class=\"block_ad_print\">"
		       "<!-- block_ad_print END -->")
  (shimbun-remove-tags "<!--AD_ART_S-->" "<!--AD_ART_S END-->"))

(luna-define-method shimbun-multi-clear-contents ((shimbun shimbun-cnet-jp)
						  header
						  has-previous-page
						  has-next-page)
  (when (shimbun-clear-contents shimbun header)
    (cond
     (has-next-page
      (goto-char (point-max))
      (when (search-backward "<div class=\"navi_paging_alt\">" nil t)
	(delete-region (point) (point-max))))
     (has-previous-page
      (shimbun-remove-tags "<div class=\"navi_paging_alt\">"
			   "<!-- navi_paging_alt END -->")))
    t))

(luna-define-method shimbun-make-contents :before ((shimbun shimbun-cnet-jp)
						   header)
  (goto-char (point-min))
  (when (re-search-forward "\\(s.prop2=\"\\([^\"]+\\)\"\\|\
<dt +class=\"author\">\\([^\n]+\\)</dt>\\)" nil t)
    (let ((from (or (match-string 2) (match-string 3))))
      (setq from (shimbun-replace-in-string from "$BJ8!'(B" ""))
      (setq from (shimbun-replace-in-string from "$BK]Lu9;@5!'(B*" ""))
      (setq from (shimbun-replace-in-string from " *<br */?> *" ", "))
      (setq from (shimbun-replace-in-string from "$B!"(B" ", "))
      (shimbun-header-set-from header from))))

(provide 'sb-cnet-jp)

;;; sb-cnet-jp.el ends here