From: bg66 Date: Mon, 19 Feb 2007 00:53:17 +0000 (+0000) Subject: * mixi.el (mixi-news-finished-regexp): New regexp. X-Git-Tag: mixi-el-1_0_0~69 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=5d9a719b31153f6b04a36082c6192d25d8f579ee;p=elisp%2Fmixi.git * mixi.el (mixi-news-finished-regexp): New regexp. (mixi-realize-news): Use it. --- diff --git a/ChangeLog b/ChangeLog index b693135..a41eb53 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-02-19 OHASHI Akira + + * mixi.el (mixi-news-finished-regexp): New regexp. + (mixi-realize-news): Use it. + 2007-02-16 OHASHI Akira * mixi.el: Add autoload cookies. diff --git a/mixi.el b/mixi.el index 1ecf419..f63bcec 100644 --- a/mixi.el +++ b/mixi.el @@ -2764,6 +2764,9 @@ Increase this value when unexpected error frequently occurs." `(concat "http://news.mixi.jp/view_news.pl?id=" (mixi-news-id ,news) "&media_id=" (mixi-news-media-id ,news))) + +(defconst mixi-news-finished-regexp + " ¿½¤·Ìõ¤´¤¶¤¤¤Þ¤»¤ó¤¬¡¢¤³¤Î¥Ë¥å¡¼¥¹¤Ï·ÇºÜ½ªÎ»¤·¤Þ¤·¤¿¡£") (defconst mixi-news-title-regexp "\\(.+\\)\\( \\)?") @@ -2784,26 +2787,28 @@ Increase this value when unexpected error frequently occurs." ;; FIXME: Check a expiration of cache? (unless (mixi-object-realized-p news) (with-mixi-retrieve (mixi-news-page news) - (if (re-search-forward mixi-news-title-regexp nil t) - (mixi-news-set-title news (match-string 1)) - (mixi-realization-error 'cannot-find-title news)) - (if (re-search-forward mixi-news-media-time-regexp nil t) - (progn - (mixi-news-set-media news (match-string 1)) - (let ((year (nth 5 (decode-time (current-time)))) - (month (nth 4 (decode-time (current-time)))) - (month-of-item (string-to-number (match-string 2)))) - (when (> month-of-item month) - (decf year)) - (mixi-news-set-time - news (encode-time 0 (string-to-number (match-string 5)) - (string-to-number (match-string 4)) - (string-to-number (match-string 3)) - month year)))) - (mixi-realization-error 'cannot-find-media-time news)) - (if (re-search-forward mixi-news-content-regexp nil t) - (mixi-news-set-content news (match-string 1)) - (mixi-realization-error 'cannot-find-content news))) + (if (re-search-forward mixi-news-finished-regexp nil t) + (mixi-news-set-content news (match-string 0)) + (if (re-search-forward mixi-news-title-regexp nil t) + (mixi-news-set-title news (match-string 1)) + (mixi-realization-error 'cannot-find-title news)) + (if (re-search-forward mixi-news-media-time-regexp nil t) + (progn + (mixi-news-set-media news (match-string 1)) + (let ((year (nth 5 (decode-time (current-time)))) + (month (nth 4 (decode-time (current-time)))) + (month-of-item (string-to-number (match-string 2)))) + (when (> month-of-item month) + (decf year)) + (mixi-news-set-time + news (encode-time 0 (string-to-number (match-string 5)) + (string-to-number (match-string 4)) + (string-to-number (match-string 3)) + month year)))) + (mixi-realization-error 'cannot-find-media-time news)) + (if (re-search-forward mixi-news-content-regexp nil t) + (mixi-news-set-content news (match-string 1)) + (mixi-realization-error 'cannot-find-content news)))) (mixi-object-touch news))) (defun mixi-news-media-id (news)