[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sb-nikkei.el
- From: 野宮 賢 / NOMIYA Masaru <nomiya@xxxxxxxxxxxxxxxx>
- Date: Mon, 03 Dec 2007 13:32:44 +0900
- X-ml-name: emacs-w3m
- X-mail-count: 09805
野宮です.
昨日,日経新聞の「マネー&マーケット面」が変更されましたので,パッチを作成
してみました.
叩き台にでもして戴ければ幸甚です.
--- sb-nikkei.el.orig 2007-11-16 18:53:12.000000000 +0900
+++ sb-nikkei.el 2007-12-03 13:16:54.000000000 +0900
@@ -174,37 +174,37 @@
"http://it.nikkei.co.jp/pc/news/index.aspx?ichiran=True"
shimbun-nikkei-get-headers-it-pc
shimbun-nikkei-prepare-article-default2)
- ("kokunai" "市場概況" "http://markets.nikkei.co.jp/kokunai/summary.cfm"
- shimbun-nikkei-get-headers-kawase
- shimbun-nikkei-prepare-article-default3)
- ("markets" "海外株概況" "http://markets.nikkei.co.jp/kaigai/summary.cfm"
- shimbun-nikkei-get-headers-markets
- shimbun-nikkei-prepare-article-default3)
- ("kawase" "為替概況" "http://markets.nikkei.co.jp/kawase/summary.cfm"
- shimbun-nikkei-get-headers-kawase
- shimbun-nikkei-prepare-article-default3)
+ ("kokunai" "市場概況" "http://markets.nikkei.co.jp/kokunai/summary.aspx"
+ shimbun-nikkei-get-headers-stock
+ shimbun-nikkei-prepare-article-default4)
+ ("markets" "海外株概況" "http://markets.nikkei.co.jp/kaigai/summary.aspx"
+ shimbun-nikkei-get-headers-stock
+ shimbun-nikkei-prepare-article-default4)
+ ("kawase" "為替概況" "http://markets.nikkei.co.jp/kawase/summary.aspx"
+ shimbun-nikkei-get-headers-stock
+ shimbun-nikkei-prepare-article-default4)
("kinri" "短期金利・債権・CB概況"
- "http://markets.nikkei.co.jp/kawase/kinri.cfm"
- shimbun-nikkei-get-headers-kinri
- shimbun-nikkei-prepare-article-default3)
+ "http://markets.nikkei.co.jp/kawase/kinri.aspx"
+ shimbun-nikkei-get-headers-stock
+ shimbun-nikkei-prepare-article-default4)
("ft" "英フィナンシャル・タイムズ"
- "http://markets.nikkei.co.jp/kaigai/ft.cfm"
+ "http://markets.nikkei.co.jp/kaigai/ft.aspx"
shimbun-nikkei-get-headers-ft
- shimbun-nikkei-prepare-article-default3)
- ("dj" "米ダウ・ジョーンズ" "http://markets.nikkei.co.jp/kaigai/dj.cfm"
+ shimbun-nikkei-prepare-article-default4)
+ ("dj" "米ダウ・ジョーンズ" "http://markets.nikkei.co.jp/kaigai/dj.aspx"
shimbun-nikkei-get-headers-dj
- shimbun-nikkei-prepare-article-default3)
+ shimbun-nikkei-prepare-article-default4)
("ngyoseki" "企業業績ニュース"
- "http://markets.nikkei.co.jp/kokunai/gyoseki.cfm"
- shimbun-nikkei-get-headers-gyoseki
- shimbun-nikkei-prepare-article-default3)
+ "http://markets.nikkei.co.jp/kokunai/gyoseki.aspx"
+ shimbun-nikkei-get-headers-stock
+ shimbun-nikkei-prepare-article-default4)
("gyosuuchi" "業績数値"
- "http://markets.nikkei.co.jp/kokunai/bunkatsu2.cfm?genre=m4"
- shimbun-nikkei-get-headers-bunkatsu2
- shimbun-nikkei-prepare-article-bunkatsu2)
- ("gyoseki" "海外企業業績" "http://markets.nikkei.co.jp/kaigai/gyoseki.cfm"
- shimbun-nikkei-get-headers-gyoseki
- shimbun-nikkei-prepare-article-default3)
+ "http://markets.nikkei.co.jp/kokunai/bunkatsu2.aspx?genre=m4"
+ shimbun-nikkei-get-headers-gyosuuchi
+ shimbun-nikkei-prepare-article-default4)
+ ("gyoseki" "海外企業業績" "http://markets.nikkei.co.jp/kaigai/gyoseki.aspx"
+ shimbun-nikkei-get-headers-stock
+ shimbun-nikkei-prepare-article-default4)
("china" "中国ビジネス事情" ,(concat shimbun-nikkei-url "china/news/")
shimbun-nikkei-get-headers-china
shimbun-nikkei-prepare-article-default4)
@@ -854,184 +854,29 @@
(throw 'stop nil))))
headers))
-(defun shimbun-nikkei-get-headers-markets (group folder shimbun range)
- "Function used to fetch headers for the markets group."
- (let (headers)
- (while (re-search-forward
- (eval-when-compile
- (let ((s0 "[\t\n ]*")
- (s1 "[\t\n ]+"))
- (concat "<a" s1 "href=\"summary\\.cfm"
- ;; 1. url
- "\\(\\?genre="
- ;; 2. serial number
- "\\([^\"]+date="
- ;; 3. year
- "\\(20[0-9][0-9]\\)"
- "[01][0-9][0-3][0-9]"
- "\\)"
- "\\)"
- s0 "\"" s0 ">" s0
- ;; 4. subject
- "\\([^<]+\\)"
- s0 "("
- ;; 5. month
- "\\([01]?[0-9]\\)"
- "/"
- ;; 6. day
- "\\([0-3]?[0-9]\\)"
- s1
- ;; 7. hour
- "\\([0-2]?[0-9]\\)"
- ":"
- ;; 8. minute
- "\\([0-5]?[0-9]\\)"
- ")" s0 "</a>")))
- nil t)
- (push (shimbun-create-header
- 0
- (match-string 4)
- shimbun-nikkei-from-address
- (shimbun-nikkei-make-date-string
- (string-to-number (match-string 3))
- (string-to-number (match-string 5))
- (string-to-number (match-string 6))
- (format "%02d:%02d"
- (string-to-number (match-string 7))
- (string-to-number (match-string 8))))
- (concat "<" (downcase (match-string 2)) "%" group "."
- shimbun-nikkei-top-level-domain ">")
- "" 0 0
- (shimbun-nikkei-expand-url (match-string 1) folder))
- headers))
- headers))
-
-(defun shimbun-nikkei-get-headers-kawase (group folder shimbun range)
- "Function used to fetch headers for the kawase group."
- (let (headers)
- (while (re-search-forward
- (eval-when-compile
- (let ((s0 "[\t\n ]*")
- (s1 "[\t\n ]+"))
- (concat "<a" s1 "href=\"summary\\.cfm"
- ;; 1. url
- "\\(\\?id="
- ;; 2. serial number
- "\\([^\"]+date="
- ;; 3. year
- "\\(20[0-9][0-9]\\)"
- "[01][0-9][0-3][0-9]"
- "\\)"
- "\\)"
- s0 "\"" s0 ">" s0
- ;; 4. subject
- "\\([^<]+\\)"
- s0 "("
- ;; 5. month
- "\\([01]?[0-9]\\)"
- "/"
- ;; 6. day
- "\\([0-3]?[0-9]\\)"
- s1
- ;; 7. hour
- "\\([0-2]?[0-9]\\)"
- ":"
- ;; 8. minute
- "\\([0-5]?[0-9]\\)"
- ")" s0 "</a>")))
- nil t)
- (push (shimbun-create-header
- 0
- (match-string 4)
- shimbun-nikkei-from-address
- (shimbun-nikkei-make-date-string
- (string-to-number (match-string 3))
- (string-to-number (match-string 5))
- (string-to-number (match-string 6))
- (format "%02d:%02d"
- (string-to-number (match-string 7))
- (string-to-number (match-string 8))))
- (concat "<" (downcase (match-string 2)) "%" group "."
- shimbun-nikkei-top-level-domain ">")
- "" 0 0
- (shimbun-nikkei-expand-url (match-string 1) folder))
- headers))
- headers))
-
-(defun shimbun-nikkei-get-headers-bunkatsu2 (group folder shimbun range)
- "Function used to fetch headers for the gyosuuchi group."
- (let (headers)
- (while (re-search-forward
- (eval-when-compile
- (let ((s0 "[\t\n ]*")
- (s1 "[\t\n ]+"))
- (concat "<a" s1 "href=\""
- ;; 1. url
- "\\(bunkatsu[0-9]\\.cfm\\?genre=m4&id="
- ;; 2. serial number
- "\\([^\"]+date="
- ;; 3. year
- "\\(20[0-9][0-9]\\)"
- "[01][0-9][0-3][0-9][^\"]+"
- "\\)"
- "\\)"
- s0 "\"" s0 ">" s0
- ;; 4. subject
- "\\([^<]+\\)"
- s0 "("
- ;; 5. month
- "\\([01]?[0-9]\\)"
- "/"
- ;; 6. day
- "\\([0-3]?[0-9]\\)"
- s1
- ;; 7. hour
- "\\([0-2]?[0-9]\\)"
- ":"
- ;; 8. minute
- "\\([0-5]?[0-9]\\)"
- ")" s0 "</a>")))
- nil t)
- (push (shimbun-create-header
- 0
- (match-string 4)
- shimbun-nikkei-from-address
- (shimbun-nikkei-make-date-string
- (string-to-number (match-string 3))
- (string-to-number (match-string 5))
- (string-to-number (match-string 6))
- (format "%02d:%02d"
- (string-to-number (match-string 7))
- (string-to-number (match-string 8))))
- (concat "<" (downcase (match-string 2)) "%" group "."
- shimbun-nikkei-top-level-domain ">")
- "" 0 0
- (shimbun-nikkei-expand-url
- (match-string 1) "http://markets.nikkei.co.jp/kokunai/"))
- headers))
- headers))
-
-(defun shimbun-nikkei-get-headers-kinri (group folder shimbun range)
- "Function used to fetch headers for the kinri group."
+(defun shimbun-nikkei-get-headers-stock (group folder shimbun range)
+ "Function used to fetch headers for the kokunai, markets, kawase, kinri,
+ ngyoseki, and gyoseki group."
(let (headers)
(while (re-search-forward
(eval-when-compile
(let ((s0 "[\t\n ]*")
(s1 "[\t\n ]+"))
- (concat "<a" s1 "href=\"kinri\\.cfm"
+ (concat "<a" s1 "\
+href=\"http://markets\\.nikkei\\.co\\.jp/[a-z]+/[a-z0-9]+\\.aspx"
;; 1. url
- "\\(\\?id="
+ "\\(\\?site="
;; 2. serial number
- "\\([^\"]+date="
+ "\\(MARKET&genre=[a-z0-9]+&id=[A-Z0-9]+"
+ "\\(?:[\t\n ]+\\)?[0-3][0-9][01][0-9]"
;; 3. year
"\\(20[0-9][0-9]\\)"
- "[01][0-9][0-3][0-9]"
"\\)"
"\\)"
- s0 "\"" s0 ">" s0
+ "\"" s0 ">" s0
;; 4. subject
"\\([^<]+\\)"
- s0 "("
+ "</a>" "\\(?:\n\\)?" "\\(?:\n\\)?" "[\t\n ]+("
;; 5. month
"\\([01]?[0-9]\\)"
"/"
@@ -1043,7 +888,7 @@
":"
;; 8. minute
"\\([0-5]?[0-9]\\)"
- ")" s0 "</a>")))
+ ")" s0 "\\(?:[\t\n ]+\\)?" "</li>")))
nil t)
(push (shimbun-create-header
0
@@ -1056,12 +901,12 @@
(format "%02d:%02d"
(string-to-number (match-string 7))
(string-to-number (match-string 8))))
- (concat "<" (downcase (match-string 2)) "%" group "."
+ (concat "<" (match-string 2) "%" group "."
shimbun-nikkei-top-level-domain ">")
"" 0 0
(shimbun-nikkei-expand-url (match-string 1) folder))
headers))
- headers))
+ (shimbun-sort-headers headers)))
(defun shimbun-nikkei-get-headers-ft (group folder shimbun range)
"Function used to fetch headers for the ft group."
@@ -1070,26 +915,27 @@
(eval-when-compile
(let ((s0 "[\t\n ]*")
(s1 "[\t\n ]+"))
- (concat "<a" s1 "href=\"ft\\.cfm"
+ (concat "<a" s1 "href=\"\
+http://markets\\.nikkei\\.co\\.jp/kaigai/ft\\.aspx"
;; 1. url
- "\\(\\?id="
+ "\\(\\?site="
;; 2. serial number
- "\\([^\"]+date="
+ "\\(MARKET&genre=ff&id=[A-Z0-9]+[\t\n ]+"
+ "[0-9][0-9][0-9][0-9]"
;; 3. year
"\\(20[0-9][0-9]\\)"
- "[01][0-9][0-3][0-9]"
"\\)"
"\\)"
- s0 "\"" s0 ">" s0
+ "\"" s0 ">" s0
;; 4. subject
"\\([^<]+\\)"
- s0 "[(|(]"
+ s0 "[((]"
;; 5. month
"\\([01]?[0-9]\\)"
"/"
;; 6. day
"\\([0-3]?[0-9]\\)"
- "[)|)]" s0 "※" s0 "</a>")))
+ "[))]")))
nil t)
(push (shimbun-create-header
0
@@ -1098,8 +944,8 @@
(shimbun-nikkei-make-date-string
(string-to-number (match-string 3))
(string-to-number (match-string 5))
- (string-to-number (match-string 6)))
- (concat "<" (downcase (match-string 2)) "%" group "."
+ (1+ (string-to-number (match-string 6))))
+ (concat "<" (match-string 2) "%" group "."
shimbun-nikkei-top-level-domain ">")
"" 0 0
(shimbun-nikkei-expand-url (match-string 1) folder))
@@ -1113,32 +959,27 @@
(eval-when-compile
(let ((s0 "[\t\n ]*")
(s1 "[\t\n ]+"))
- (concat "<a" s1 "href=\"dj\\.cfm"
+ (concat "<a" s1 "href=\"\
+http://markets\\.nikkei\\.co.jp/kaigai/dj\\.aspx"
;; 1. url
- "\\(\\?id="
+ "\\(\\?site="
;; 2. serial number
- "\\([^\"]+date="
+ "\\(MARKET&genre=[a-z]+&id=[A-Z0-9]+"
+ "\\(?:[\t\n ]+\\)?[0-3][0-9][01][0-9]"
;; 3. year
"\\(20[0-9][0-9]\\)"
- "[01][0-9][0-3][0-9]"
"\\)"
"\\)"
- s0 "\"" s0 ">" s0
+ "\"" s0 ">\\(?:<DJ>\\)?" s0
;; 4. subject
"\\([^<]+\\)"
- s0 "("
+ s0 "[((]"
;; 5. month
"\\([01]?[0-9]\\)"
"/"
;; 6. day
"\\([0-3]?[0-9]\\)"
- s1
- ;; 7. hour
- "\\([0-2]?[0-9]\\)"
- ":"
- ;; 8. minute
- "\\([0-5]?[0-9]\\)"
- ")" s0 "</a>")))
+ "[))]" s0 "</a>")))
nil t)
(push (shimbun-create-header
0
@@ -1147,38 +988,36 @@
(shimbun-nikkei-make-date-string
(string-to-number (match-string 3))
(string-to-number (match-string 5))
- (string-to-number (match-string 6))
- (format "%02d:%02d"
- (string-to-number (match-string 7))
- (string-to-number (match-string 8))))
- (concat "<" (downcase (match-string 2)) "%" group "."
+ (string-to-number (match-string 6)))
+ (concat "<" (match-string 2) "%" group "."
shimbun-nikkei-top-level-domain ">")
"" 0 0
(shimbun-nikkei-expand-url (match-string 1) folder))
headers))
- headers))
+ (shimbun-sort-headers headers)))
-(defun shimbun-nikkei-get-headers-gyoseki (group folder shimbun range)
- "Function used to fetch headers for the gyoseki group."
+(defun shimbun-nikkei-get-headers-gyosuuchi (group folder shimbun range)
+ "Function used to fetch headers for the gyosuuchi group."
(let (headers)
- (while (re-search-forward
+ (while (re-search-forward
(eval-when-compile
(let ((s0 "[\t\n ]*")
(s1 "[\t\n ]+"))
- (concat "<a" s1 "href=\"gyoseki\\.cfm"
+ (concat "<a" s1 "\
+href=\"http://markets\\.nikkei\\.co\\.jp/[a-z]+/[a-z0-9]+\\.aspx"
;; 1. url
- "\\(\\?id="
+ "\\(\\?site="
;; 2. serial number
- "\\([^\"]+date="
+ "\\(MARKET&genre=[a-z0-9]+&id=[A-Z0-9]+"
+ "\\(?:[\t\n ]+\\)?[0-3][0-9][01][0-9]"
;; 3. year
"\\(20[0-9][0-9]\\)"
- "[01][0-9][0-3][0-9]"
"\\)"
"\\)"
- s0 "\"" s0 ">" s0
+ "\"" s0 ">" s0
;; 4. subject
"\\([^<]+\\)"
- s0 "("
+ "</a>" "\\(?:\n\\)?" "\\(?:\n\\)?" "[\t\n ]+("
;; 5. month
"\\([01]?[0-9]\\)"
"/"
@@ -1190,7 +1029,7 @@
":"
;; 8. minute
"\\([0-5]?[0-9]\\)"
- ")" s0 "</a>")))
+ ")" s0 "\\(?:[\t\n ]+\\)?" "</li>")))
nil t)
(push (shimbun-create-header
0
@@ -1203,12 +1042,14 @@
(format "%02d:%02d"
(string-to-number (match-string 7))
(string-to-number (match-string 8))))
- (concat "<" (downcase (match-string 2)) "%" group "."
+ (concat "<" (match-string 2) "%" group "."
shimbun-nikkei-top-level-domain ">")
"" 0 0
- (shimbun-nikkei-expand-url (match-string 1) folder))
+ (shimbun-nikkei-expand-url
+ (concat "\
+http://markets.nikkei.co.jp/kokunai/bunkatsu3.aspx" (match-string 1)) folder))
headers))
- headers))
+ (shimbun-sort-headers headers)))
(defun shimbun-nikkei-get-headers-market (group folder shimbun range)
"Function used to fetch headers for the market group."
@@ -2084,11 +1925,13 @@
(defun shimbun-nikkei-prepare-article-default4 (&rest args)
"Function used to prepare contents of an article for some groups."
(when (re-search-forward "\
-<!-+[\t\n ]*FJZONE[\t\n ]+START[\t\n ]+NAME=\"HONBUN\"[\t\n ]*-+>"
+<!-+[\t\n ]*FJZONE[\t\n ]+START[\t\n ]+NAME=\"HONBUN\"[\t\n ]*-+>\
+\\|</h2>\n[\t\n ]+<p>"
nil t)
(insert shimbun-nikkei-content-start)
(when (re-search-forward "\
-<!-+[\t\n ]*FJZONE[\t\n ]+END[\t\n ]+NAME=\"HONBUN\"[\t\n ]*-+>"
+<!-+[\t\n ]*FJZONE[\t\n ]+END[\t\n ]+NAME=\"HONBUN\"[\t\n ]*-+>\
+\\|<script[\t\n ]+language=\"javascript\"[\t\n ]+type=\"text/javascript\">"
nil t)
(goto-char (match-beginning 0))
(insert shimbun-nikkei-content-end)
---
野宮