From: bg66 Date: Fri, 12 Jan 2007 03:58:08 +0000 (+0000) Subject: * mixi.el (mixi-diary-list-regexp): Fix regexp. X-Git-Tag: mixi-el-1_0_0~114 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=447606fad7ca51dfb6a09373a275925eb6822408;p=elisp%2Fmixi.git * mixi.el (mixi-diary-list-regexp): Fix regexp. (mixi-get-diaries): Follow the change above. (mixi-diary-time): Ditto. (mixi-diary-title): Ditto. (mixi-new-diary-list-regexp): Fix regexp. (mixi-get-new-diaries): Follow the change above. (mixi-search-diary-list-regexp): Fix regexp. (mixi-search-diaries): Follow the change above. --- diff --git a/ChangeLog b/ChangeLog index 8457395..91cae92 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2007-01-12 OHASHI Akira + + * mixi.el (mixi-diary-list-regexp): Fix regexp. + (mixi-get-diaries): Follow the change above. + (mixi-diary-time): Ditto. + (mixi-diary-title): Ditto. + (mixi-new-diary-list-regexp): Fix regexp. + (mixi-get-new-diaries): Follow the change above. + (mixi-search-diary-list-regexp): Fix regexp. + (mixi-search-diaries): Follow the change above. + 2007-01-11 OHASHI Akira * mixi.el (mixi-community-birthday-regexp): Follow the change of mixi. diff --git a/mixi.el b/mixi.el index ebe2d5c..898059c 100644 --- a/mixi.el +++ b/mixi.el @@ -1166,14 +1166,16 @@ Increase this value when unexpected error frequently occurs." "Return the time of DIARY." (unless (mixi-diary-p diary) (signal 'wrong-type-argument (list 'mixi-diary-p diary))) - (mixi-realize-diary diary) + (unless (aref (cdr diary) 3) + (mixi-realize-diary diary)) (aref (cdr diary) 3)) (defun mixi-diary-title (diary) "Return the title of DIARY." (unless (mixi-diary-p diary) (signal 'wrong-type-argument (list 'mixi-diary-p diary))) - (mixi-realize-diary diary) + (unless (aref (cdr diary) 4) + (mixi-realize-diary diary)) (aref (cdr diary) 4)) (defun mixi-diary-content (diary) @@ -1206,7 +1208,23 @@ Increase this value when unexpected error frequently occurs." (when ,friend (concat "&id=" (mixi-friend-id ,friend))))) (defconst mixi-diary-list-regexp - "") + " +\\([0-9]+\\)·î\\([0-9]+\\)Æü
\\([0-9]+\\):\\([0-9]+\\)
\\(
\\|\\) + 
\\(.*\\) + + + + + + +
+ +\\(.*\\) + +?
+ +
+") (defun mixi-get-diaries (&rest friend-or-range) "Get diaries of FRIEND." @@ -1222,16 +1240,29 @@ Increase this value when unexpected error frequently occurs." (signal 'wrong-type-argument (list 'mixi-friend-p friend))) (let ((items (mixi-get-matched-items (mixi-diary-list-page friend) mixi-diary-list-regexp - range))) + range)) + (year (nth 5 (decode-time (current-time)))) + (month (nth 4 (decode-time (current-time))))) (mapcar (lambda (item) - (mixi-make-diary friend (nth 0 item))) + (let ((month-of-item (string-to-number (nth 0 item)))) + (when (> month-of-item month) + (decf year)) + (setq month month-of-item) + (mixi-make-diary friend (nth 5 item) + (encode-time + 0 (string-to-number (nth 3 item)) + (string-to-number (nth 2 item)) + (string-to-number (nth 1 item)) + month year) + (nth 6 item) (nth 7 item)))) items)))) (defmacro mixi-new-diary-list-page () `(concat "/new_friend_diary.pl?page=%d")) (defconst mixi-new-diary-list-regexp - "") + "\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\) +\\(.+\\) (\\(.*\\)) ") (defun mixi-get-new-diaries (&optional range) "Get new diaries." @@ -1239,7 +1270,15 @@ Increase this value when unexpected error frequently occurs." mixi-new-diary-list-regexp range))) (mapcar (lambda (item) - (mixi-make-diary (mixi-make-friend (nth 1 item)) (nth 0 item))) + (mixi-make-diary (mixi-make-friend (nth 6 item) (nth 8 item)) + (nth 5 item) + (encode-time + 0 (string-to-number (nth 4 item)) + (string-to-number (nth 3 item)) + (string-to-number (nth 2 item)) + (string-to-number (nth 1 item)) + (string-to-number (nth 0 item))) + (nth 7 item))) items))) (defmacro mixi-search-diary-list-page (keyword) @@ -1247,14 +1286,47 @@ Increase this value when unexpected error frequently occurs." (mixi-url-encode-and-quote-percent-string keyword))) (defconst mixi-search-diary-list-regexp - "") + "̾  Á° +\\(.*\\) + + + + +¥¿¥¤¥È¥ë +\\(.+\\) + + +ËÜ  Ê¸ +\\(.*\\) + + + +ºîÀ®Æü»þ +\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\) +¾ÜºÙ¤ò¸«¤ë + +") (defun mixi-search-diaries (keyword &optional range) (let ((items (mixi-get-matched-items (mixi-search-diary-list-page keyword) mixi-search-diary-list-regexp - range))) + range)) + (year (nth 5 (decode-time (current-time)))) + (month (nth 4 (decode-time (current-time))))) (mapcar (lambda (item) - (mixi-make-diary (mixi-make-friend (nth 1 item)) (nth 0 item))) + (let ((month-of-item (string-to-number (nth 3 item)))) + (when (> month-of-item month) + (decf year)) + (setq month month-of-item) + (mixi-make-diary (mixi-make-friend (nth 8 item) (nth 0 item)) + (nth 7 item) + (encode-time + 0 (string-to-number (nth 6 item)) + (string-to-number (nth 5 item)) + (string-to-number (nth 4 item)) + month year) + (nth 1 item) + (nth 2 item)))) items))) (defmacro mixi-post-diary-page ()