+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.
(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))
(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."
(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))
`(concat "/view_message.pl?id=" (mixi-message-id ,message)
"&box=" (mixi-message-box ,message)))
-(defconst mixi-message-owner-regexp
- "<font COLOR=#996600>\\(º¹½Ð¿Í\\|°¸ Àè\\)</font> : <a HREF=\"show_friend\\.pl\\?id=\\([0-9]+\\)\">\\(.*\\)\\(</a>\\|</td>\\)")
-(defconst mixi-message-time-regexp
-"<font COLOR=#996600>Æü\\(¡¡\\| \\)ÉÕ</font> : \\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\)»þ\\([0-9]+\\)ʬ ")
(defconst mixi-message-title-regexp
-"<font COLOR=#996600>·ï\\(¡¡\\| \\)̾</font> : \\(.*\\)\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)))
(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)