* mixi.el (mixi-message-box-list): Add `noticebox'.
authorbg66 <bg66>
Tue, 11 Nov 2008 16:21:36 +0000 (16:21 +0000)
committerbg66 <bg66>
Tue, 11 Nov 2008 16:21:36 +0000 (16:21 +0000)
(mixi-message-list-regexp): Follow the change of mixi.
(mixi-message-title-regexp): Ditto.
(mixi-message-time-regexp): Ditto.
(mixi-message-owner-regexp): Ditto.
(mixi-message-content-regexp): Ditto.
(mixi-realize-message): Follow the change above.
* mixi-utils.el (mixi-make-author): Ditto.
(mixi-make-id-1): Ditto.
(mixi-make-reply-to): Ditto.
* sb-mixi.el (shimbun-mixi-default-group-alist): Add `messages.notice'.

ChangeLog
mixi-utils.el
mixi.el
sb-mixi.el

index ea2c3e0..f4d4fbb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2008-11-12  OHASHI Akira  <bg66@koka-in.org>
+
+       * mixi.el (mixi-message-box-list): Add `noticebox'.
+       (mixi-message-list-regexp): Follow the change of mixi.
+       (mixi-message-title-regexp): Ditto.
+       (mixi-message-time-regexp): Ditto.
+       (mixi-message-owner-regexp): Ditto.
+       (mixi-message-content-regexp): Ditto.
+       (mixi-realize-message): Follow the change above.
+       * mixi-utils.el (mixi-make-author): Ditto.
+       (mixi-make-id-1): Ditto.
+       (mixi-make-reply-to): Ditto.
+       * sb-mixi.el (shimbun-mixi-default-group-alist): Add `messages.notice'.
+
 2008-10-04  OHASHI Akira  <bg66@koka-in.org>
 
        * mixi-el: Version 2.0.0 released.
index 1ac5a4c..695dda1 100644 (file)
@@ -92,6 +92,9 @@
                   (mixi-friend-nick (mixi-comment-owner object))))
          ((eq class 'mixi-release)
           "mixi±¿±Ä»ö̳¶É")
+         ((eq class 'mixi-message)
+          (let ((owner (mixi-message-owner object)))
+            (if (null owner) "mixi" (mixi-friend-nick owner))))
          (t
           (let ((owner (if (eq class 'mixi-log)
                            (mixi-log-friend object)
            (concat (md5 (mixi-release-title object)) "@"))
           ((eq class 'mixi-echo)
            (concat (mixi-friend-id (mixi-echo-owner object)) "@"))
+          ((and (eq class 'mixi-message) (null (mixi-message-owner object)))
+           (concat (mixi-object-id object) "@"))
           (t
            (concat (mixi-object-id object) "@"
                    (if (eq class 'mixi-news)
                          (mixi-community-id object)))
                 ((or (eq class 'mixi-news) (eq object (mixi-make-me)))
                  (concat mixi-reply-to "diary"))
-                ((eq class 'mixi-message)
+                ((and (eq class 'mixi-message)
+                      (not (null (mixi-message-owner object))))
                  (concat mixi-reply-to "message;"
                          (mixi-friend-id (mixi-message-owner object))))
                 ((or (eq class 'mixi-friend) (eq class 'mixi-log))
diff --git a/mixi.el b/mixi.el
index 9951032..749128c 100644 (file)
--- a/mixi.el
+++ b/mixi.el
   (autoload 'w3m-retrieve "w3m")
   (autoload 'url-retrieve-synchronously "url"))
 
-(defconst mixi-revision "$Revision: 1.198 $")
+(defconst mixi-revision "$Revision: 1.199 $")
 
 (defgroup mixi nil
   "API library for accessing to mixi."
@@ -2529,7 +2529,8 @@ Increase this value when unexpected error frequently occurs."
        (mixi-post-error 'cannot-find-succeed parent)))))
 
 ;; Message object.
-(defconst mixi-message-box-list '(inbox outbox savebox thrash)) ; thrash?
+(defconst mixi-message-box-list
+  '(inbox outbox savebox thrash noticebox)) ; thrash?
 
 (defmacro mixi-message-box-p (box)
   `(memq ,box mixi-message-box-list))
@@ -2565,35 +2566,40 @@ Increase this value when unexpected error frequently occurs."
   `(concat "/view_message.pl?id=" (mixi-message-id ,message)
           "&box=" (mixi-message-box ,message)))
 
-(defconst mixi-message-owner-regexp
-  "<font COLOR=#996600>\\(º¹½Ð¿Í\\|°¸&nbsp;Àè\\)</font>&nbsp;:&nbsp;<a HREF=\"show_friend\\.pl\\?id=\\([0-9]+\\)\">\\(.*\\)\\(</a>\\|</td>\\)")
-(defconst mixi-message-time-regexp
-"<font COLOR=#996600>Æü\\(¡¡\\|&nbsp;\\)ÉÕ</font>&nbsp;:&nbsp;\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\)»þ\\([0-9]+\\)ʬ&nbsp;&nbsp;")
 (defconst mixi-message-title-regexp
-"<font COLOR=#996600>·ï\\(¡¡\\|&nbsp;\\)̾</font>&nbsp;:&nbsp;\\(.*\\)\n?</td>")
+"<div class=\"messageDetailHead\">
+<h3>\\(.*\\)</h3>")
+(defconst mixi-message-time-regexp
+"<dt>ÆüÉÕ</dt>
+<dd>\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\)»þ\\([0-9]+\\)ʬ</dd>")
+(defconst mixi-message-owner-regexp
+  "<dt>º¹½Ð¿Í</dt>
+<dd>\\(
+<a href=\"show_friend\\.pl\\?id=\\([0-9]+\\)\">\\(.*\\)</a>\\|mixi</dd>\\)")
 (defconst mixi-message-content-regexp
-  "<tr><td CLASS=h120 width=\"500\">\\(.*\\)</td></tr>")
+  "<div id=\"message_body\" class=\"messageDetailBody\">\\(\\(.\\|\r?\n\\)*?\\)</div>")
 
 (defun mixi-realize-message (message)
   "Realize a MESSAGE."
   (unless (mixi-object-realized-p message)
     (with-mixi-retrieve (mixi-message-page message)
-      (if (re-search-forward mixi-message-owner-regexp nil t)
-         (mixi-message-set-owner message
-                                 (mixi-make-friend (match-string 2)
-                                                   (match-string 3)))
-       (mixi-realization-error 'cannot-find-owner message))
+      (if (re-search-forward mixi-message-title-regexp nil t)
+         (mixi-message-set-title message (match-string 1))
+       (mixi-realization-error 'cannot-find-title message))
       (if (re-search-forward mixi-message-time-regexp nil t)
          (mixi-message-set-time
-          message (encode-time 0 (string-to-number (match-string 6))
-                               (string-to-number (match-string 5))
+          message (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 2))
+                               (string-to-number (match-string 1))))
        (mixi-realization-error 'cannot-find-time message))
-      (if (re-search-forward mixi-message-title-regexp nil t)
-         (mixi-message-set-title message (match-string 2))
-       (mixi-realization-error 'cannot-find-title message))
+      (if (re-search-forward mixi-message-owner-regexp nil t)
+         (unless (string= (match-string 1) "mixi</dd>")
+           (mixi-message-set-owner message
+                                   (mixi-make-friend (match-string 2)
+                                                     (match-string 3))))
+       (mixi-realization-error 'cannot-find-owner message))
       (if (re-search-forward mixi-message-content-regexp nil t)
          (mixi-message-set-content message (match-string 1))
        (mixi-realization-error 'cannot-find-content message)))
@@ -2668,7 +2674,7 @@ Increase this value when unexpected error frequently occurs."
           (when ,box (concat "&box=" ,box))))
 
 (defconst mixi-message-list-regexp
-  "<td><a HREF=\"view_message\\.pl\\?id=\\(.+\\)&box=\\(.+\\)\">")
+  "<a href=\"view_message\\.pl\\?id=\\(.+\\)&box=\\(.+\\)\">")
 
 ;;;###autoload
 (defun mixi-get-messages (&rest box-or-range)
index 0acacd5..43d0d72 100644 (file)
@@ -33,7 +33,7 @@
 (require 'mixi-utils)
 (require 'shimbun)
 
-(defconst shimbun-mixi-revision "$Revision: 1.64 $")
+(defconst shimbun-mixi-revision "$Revision: 1.65 $")
 
 (eval-and-compile
   (luna-define-class shimbun-mixi (shimbun) (comment-cache release-cache))
@@ -49,6 +49,9 @@
     ("messages.sent" .
      (lambda (range)
        (mixi-get-messages 'outbox range)))
+    ("messages.notice" .
+     (lambda (range)
+       (mixi-get-messages 'noticebox range)))
     ("logs" . mixi-get-logs)
     ("my-diaries" . "/home.pl")
     ("mixi-el" . "/view_community.pl?id=1596390")