From e3df93e038318b0c043af485ce0400ce8be37a7b Mon Sep 17 00:00:00 2001 From: bg66 Date: Fri, 23 Mar 2007 01:55:06 +0000 Subject: [PATCH] (mixi-diary-closed-regexp): Fix regexp. (mixi-diary-owner-nick-regexp): Ditto. (mixi-diary-time-regexp): Ditto. (mixi-diary-title-regexp): Ditto. (mixi-diary-content-regexp): Ditto. (mixi-realize-diary): Follow the change above. (mixi-event-community-regexp): Fix regexp. (mixi-event-time-regexp): Ditto. (mixi-event-title-regexp): Ditto. (mixi-event-owner-regexp): Ditto. (mixi-event-owner-seceded-regexp): Ditto. (mixi-event-date-regexp): Ditto. (mixi-event-place-regexp): Ditto. (mixi-event-detail-regexp): Ditto. (mixi-event-limit-regexp): Ditto. (mixi-event-members-regexp): Ditto. (mixi-realize-event): Follow the change above. --- ChangeLog | 20 ++++++++ mixi.el | 159 +++++++++++++++++++++++++++++++------------------------------ 2 files changed, 101 insertions(+), 78 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b7e37e..6f67e16 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2007-03-23 OHASHI Akira + + * mixi.el (mixi-diary-closed-regexp): Fix regexp. + (mixi-diary-owner-nick-regexp): Ditto. + (mixi-diary-time-regexp): Ditto. + (mixi-diary-title-regexp): Ditto. + (mixi-diary-content-regexp): Ditto. + (mixi-realize-diary): Follow the change above. + (mixi-event-community-regexp): Fix regexp. + (mixi-event-time-regexp): Ditto. + (mixi-event-title-regexp): Ditto. + (mixi-event-owner-regexp): Ditto. + (mixi-event-owner-seceded-regexp): Ditto. + (mixi-event-date-regexp): Ditto. + (mixi-event-place-regexp): Ditto. + (mixi-event-detail-regexp): Ditto. + (mixi-event-limit-regexp): Ditto. + (mixi-event-members-regexp): Ditto. + (mixi-realize-event): Follow the change above. + 2007-03-22 OHASHI Akira * mixi.el (mixi-community-name-regexp): Fix regexp. diff --git a/mixi.el b/mixi.el index 762f0f5..0666469 100644 --- a/mixi.el +++ b/mixi.el @@ -1157,39 +1157,41 @@ Increase this value when unexpected error frequently occurs." "&owner_id=" (mixi-friend-id (mixi-diary-owner ,diary)))) (defconst mixi-diary-closed-regexp - "ͧ¿Í\\(¤Îͧ¿Í\\)?¤Þ¤Ç¸ø³«¤Î¤¿¤áÆɤळ¤È¤¬½ÐÍè¤Þ¤»¤ó¡£") + "ͧ¿Í\\(¤Îͧ¿Í\\)?¤Þ¤Ç¸ø³«¤Î¤¿¤áÆɤळ¤È¤¬½ÐÍè¤Þ¤»¤ó¡£") (defconst mixi-diary-owner-nick-regexp - "\\(.+?\\)\\(¤µ¤ó\\)?¤ÎÆüµ­") + "\\(.+?\\)\\(¤µ¤ó\\)?¤ÎÆüµ­") (defconst mixi-diary-time-regexp - "\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü\\(
\\|
\\)\\([0-9]+\\):\\([0-9]+\\)") + "\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü\\([0-9]+\\):\\([0-9]+\\)") (defconst mixi-diary-title-regexp - " \\([^<]+\\)") + " \\([^<]+\\)") (defconst mixi-diary-content-regexp - "\\(\\(.\\|\n\\)*?\\)") + "\\(\\(.\\|\r?\n\\)*?\\)") (defun mixi-realize-diary (diary &optional page) "Realize a DIARY." ;; FIXME: Check a expiration of cache? (unless (mixi-object-realized-p diary) (with-mixi-retrieve (or page (mixi-diary-page diary)) - (unless (re-search-forward mixi-diary-closed-regexp nil t) - (if (re-search-forward mixi-diary-owner-nick-regexp nil t) - (mixi-friend-set-nick (mixi-diary-owner diary) (match-string 1)) - (mixi-realization-error 'cannot-find-owner-nick diary)) - (if (re-search-forward mixi-diary-time-regexp nil t) - (mixi-diary-set-time - diary (encode-time 0 (string-to-number (match-string 10)) - (string-to-number (match-string 9)) - (string-to-number (match-string 7)) - (string-to-number (match-string 6)) - (string-to-number (match-string 5)))) - (mixi-realization-error 'cannot-find-time diary)) - (if (re-search-forward mixi-diary-title-regexp nil t) - (mixi-diary-set-title diary (match-string 2)) - (mixi-realization-error 'cannot-find-title diary)) - (if (re-search-forward mixi-diary-content-regexp nil t) - (mixi-diary-set-content diary (match-string 2)) - (mixi-realization-error 'cannot-find-content diary)))) + (let ((case-fold-search t)) + (unless (re-search-forward mixi-diary-closed-regexp nil t) + (if (re-search-forward mixi-diary-owner-nick-regexp nil t) + (mixi-friend-set-nick (mixi-diary-owner diary) + (match-string 1)) + (mixi-realization-error 'cannot-find-owner-nick diary)) + (if (re-search-forward mixi-diary-time-regexp nil t) + (mixi-diary-set-time + diary (encode-time 0 (string-to-number (match-string 7)) + (string-to-number (match-string 6)) + (string-to-number (match-string 4)) + (string-to-number (match-string 3)) + (string-to-number (match-string 2)))) + (mixi-realization-error 'cannot-find-time diary)) + (if (re-search-forward mixi-diary-title-regexp nil t) + (mixi-diary-set-title diary (match-string 1)) + (mixi-realization-error 'cannot-find-title diary)) + (if (re-search-forward mixi-diary-content-regexp nil t) + (mixi-diary-set-content diary (match-string 1)) + (mixi-realization-error 'cannot-find-content diary))))) (mixi-object-touch diary))) (defun mixi-diary-owner (diary) @@ -1882,39 +1884,39 @@ Increase this value when unexpected error frequently occurs." "&comm_id=" (mixi-community-id (mixi-event-community ,event)))) (defconst mixi-event-community-regexp - "\\[\\(.+\\)\\] ¥¤¥Ù¥ó¥È") + "\\[\\(.+\\)\\] ¥¤¥Ù¥ó¥È") (defconst mixi-event-time-regexp - " + " ?\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü
?\\([0-9]+\\):\\([0-9]+\\)") (defconst mixi-event-title-regexp - " \\([^<]+\\)") + " \\([^<]+\\)") (defconst mixi-event-owner-regexp - " \\(.*\\)") + " \\(.*\\)") (defconst mixi-event-owner-seceded-regexp - " \\((mixi Âà²ñºÑ)\\)") + " \\((mixi Âà²ñºÑ)\\)") (defconst mixi-event-date-regexp - "³«ºÅÆü»þ - + "³«ºÅÆü»þ +  \\(.+\\) ") (defconst mixi-event-place-regexp - "³«ºÅ¾ì½ê - + "³«ºÅ¾ì½ê +  \\(.+\\) ") (defconst mixi-event-detail-regexp - "¾ÜºÙ -
\\(.+\\)
") + "¾ÜºÙ +
\\(.+\\)
") (defconst mixi-event-limit-regexp - "Ê罸´ü¸Â -? \\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü") + "Ê罸´ü¸Â +? \\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü") (defconst mixi-event-members-regexp - "»²²Ã¼Ô - + "»²²Ã¼Ô + ? -? +?
?") @@ -1924,45 +1926,46 @@ Increase this value when unexpected error frequently occurs." ;; FIXME: Check a expiration of cache? (unless (mixi-object-realized-p event) (with-mixi-retrieve (or page (mixi-event-page event)) - (if (re-search-forward mixi-event-community-regexp nil t) - (mixi-community-set-name (mixi-event-community event) - (match-string 1)) - (mixi-realization-error 'cannot-find-community event)) - (if (re-search-forward mixi-event-time-regexp nil t) - (mixi-event-set-time - event (encode-time 0 (string-to-number (match-string 8)) - (string-to-number (match-string 7)) - (string-to-number (match-string 6)) - (string-to-number (match-string 5)) - (string-to-number (match-string 4)))) - (mixi-realization-error 'cannot-find-time event)) - (if (re-search-forward mixi-event-title-regexp nil t) - (mixi-event-set-title event (match-string 2)) - (mixi-realization-error 'cannot-find-title event)) - (if (re-search-forward mixi-event-owner-regexp nil t) - (mixi-event-set-owner event (mixi-make-friend (match-string 2) - (match-string 3))) - (if (re-search-forward mixi-event-owner-seceded-regexp nil t) - (mixi-event-set-owner event - (mixi-make-friend nil (match-string 2))) - (mixi-realization-error 'cannot-find-owner event))) - (if (re-search-forward mixi-event-date-regexp nil t) - (mixi-event-set-date event (match-string 6)) - (mixi-realization-error 'cannot-find-date event)) - (if (re-search-forward mixi-event-place-regexp nil t) - (mixi-event-set-place event (match-string 6)) - (mixi-realization-error 'cannot-find-place event)) - (if (re-search-forward mixi-event-detail-regexp nil t) - (mixi-event-set-detail event (match-string 6)) - (mixi-realization-error 'cannot-find-detail event)) - (when (re-search-forward mixi-event-limit-regexp nil t) - (mixi-event-set-limit - event (encode-time 0 0 0 (string-to-number (match-string 8)) - (string-to-number (match-string 7)) - (string-to-number (match-string 6))))) - (if (re-search-forward mixi-event-members-regexp nil t) - (mixi-event-set-members event (match-string 6)) - (mixi-realization-error 'cannot-find-members event))) + (let ((case-fold-search t)) + (if (re-search-forward mixi-event-community-regexp nil t) + (mixi-community-set-name (mixi-event-community event) + (match-string 1)) + (mixi-realization-error 'cannot-find-community event)) + (if (re-search-forward mixi-event-time-regexp nil t) + (mixi-event-set-time + event (encode-time 0 (string-to-number (match-string 5)) + (string-to-number (match-string 4)) + (string-to-number (match-string 3)) + (string-to-number (match-string 2)) + (string-to-number (match-string 1)))) + (mixi-realization-error 'cannot-find-time event)) + (if (re-search-forward mixi-event-title-regexp nil t) + (mixi-event-set-title event (match-string 2)) + (mixi-realization-error 'cannot-find-title event)) + (if (re-search-forward mixi-event-owner-regexp nil t) + (mixi-event-set-owner event (mixi-make-friend (match-string 1) + (match-string 2))) + (if (re-search-forward mixi-event-owner-seceded-regexp nil t) + (mixi-event-set-owner event + (mixi-make-friend nil (match-string 1))) + (mixi-realization-error 'cannot-find-owner event))) + (if (re-search-forward mixi-event-date-regexp nil t) + (mixi-event-set-date event (match-string 1)) + (mixi-realization-error 'cannot-find-date event)) + (if (re-search-forward mixi-event-place-regexp nil t) + (mixi-event-set-place event (match-string 1)) + (mixi-realization-error 'cannot-find-place event)) + (if (re-search-forward mixi-event-detail-regexp nil t) + (mixi-event-set-detail event (match-string 1)) + (mixi-realization-error 'cannot-find-detail event)) + (when (re-search-forward mixi-event-limit-regexp nil t) + (mixi-event-set-limit + event (encode-time 0 0 0 (string-to-number (match-string 3)) + (string-to-number (match-string 2)) + (string-to-number (match-string 1))))) + (if (re-search-forward mixi-event-members-regexp nil t) + (mixi-event-set-members event (match-string 1)) + (mixi-realization-error 'cannot-find-members event)))) (mixi-object-touch event))) (defun mixi-event-community (event) -- 1.7.10.4
 \\(.+\\)