From: bg66 Date: Tue, 30 Jan 2007 01:12:24 +0000 (+0000) Subject: * mixi.el (mixi-make-object-from-url): Support friend object. X-Git-Tag: mixi-el-1_0_0~81 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc9d1f707c9eef0154a63ff4107fbd1f21aa3e9a;p=elisp%2Fmixi.git * mixi.el (mixi-make-object-from-url): Support friend object. (mixi-friend-url-regexp): Support profile page. (mixi-make-friend-from-url): Follow the change above. * sb-mixi.el (shimbun-mixi-group-alist): Add logs group. (shimbun-mixi-make-subject): Support log object. (shimbun-mixi-make-from): Ditto. (shimbun-mixi-make-message-id): Ditto. (shimbun-mixi-make-xref): Support log and friend object. (shimbun-mixi-make-body): Support friend object. --- diff --git a/ChangeLog b/ChangeLog index 280ea61..bb34c8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2007-01-30 OHASHI Akira + + * mixi.el (mixi-make-object-from-url): Support friend object. + (mixi-friend-url-regexp): Support profile page. + (mixi-make-friend-from-url): Follow the change above. + + * sb-mixi.el (shimbun-mixi-group-alist): Add logs group. + (shimbun-mixi-make-subject): Support log object. + (shimbun-mixi-make-from): Ditto. + (shimbun-mixi-make-message-id): Ditto. + (shimbun-mixi-make-xref): Support log and friend object. + (shimbun-mixi-make-body): Support friend object. + 2007-01-24 OHASHI Akira * sb-mixi.el (shimbun-mixi-group-alist): Add `messages.sent' and diff --git a/mixi.el b/mixi.el index 2e10f59..ac18a8f 100644 --- a/mixi.el +++ b/mixi.el @@ -609,8 +609,10 @@ Increase this value when unexpected error frequently occurs." "Return a mixi object from URL." (if (string-match mixi-object-url-regexp url) (let ((name (match-string 2 url))) - (when (string= name "bbs") - (setq name "topic")) + (cond ((string= name "bbs") + (setq name "topic")) + ((string= name "profile") + (setq name "friend"))) (let ((func (intern (concat mixi-object-prefix "make-" name "-from-url")))) (funcall func url))) @@ -758,12 +760,12 @@ Increase this value when unexpected error frequently occurs." mixi-me) (defconst mixi-friend-url-regexp - "/show_friend\\.pl\\?id=\\([0-9]+\\)") + "/show_\\(friend\\|profile\\)\\.pl\\?id=\\([0-9]+\\)") (defun mixi-make-friend-from-url (url) "Return a friend object from URL." (if (string-match mixi-friend-url-regexp url) - (let ((id (match-string 1 url))) + (let ((id (match-string 2 url))) (mixi-make-friend id)) (when (string-match "/home\\.pl" url) (mixi-make-me)))) diff --git a/sb-mixi.el b/sb-mixi.el index 8b2e77b..a346df2 100644 --- a/sb-mixi.el +++ b/sb-mixi.el @@ -44,6 +44,7 @@ ("messages.sent" . (lambda (range) (mixi-get-messages 'outbox range))) + ("logs" . mixi-get-logs) ("my-diaries" . "/home.pl") ("mixi-el" . "/view_community.pl?id=1596390") ("news.newest.domestic" . @@ -143,27 +144,33 @@ of mixi object." (defun shimbun-mixi-make-subject (shimbun object) (let ((class (mixi-object-class object))) - (if (eq class 'mixi-comment) - (concat "Re: " (shimbun-mixi-make-subject - shimbun (mixi-comment-parent object))) - (let ((prefix (when (eq class 'mixi-event) "[¥¤¥Ù¥ó¥È]")) - (subject (mixi-object-title object)) - (suffix (when (string-match - "^new-" (shimbun-current-group-internal shimbun)) - (concat " (" - (if (eq class 'mixi-diary) - (mixi-friend-nick - (mixi-diary-owner object)) - (mixi-community-name - (mixi-bbs-community object))) - ")")))) - (concat prefix subject suffix))))) + (cond ((eq class 'mixi-comment) + (concat "Re: " (shimbun-mixi-make-subject + shimbun (mixi-comment-parent object)))) + ((eq class 'mixi-log) + (mixi-friend-nick (mixi-log-friend object))) + (t + (let ((prefix (when (eq class 'mixi-event) "[¥¤¥Ù¥ó¥È]")) + (subject (mixi-object-title object)) + (suffix (when (string-match + "^new-" + (shimbun-current-group-internal shimbun)) + (concat " (" + (if (eq class 'mixi-diary) + (mixi-friend-nick + (mixi-diary-owner object)) + (mixi-community-name + (mixi-bbs-community object))) + ")")))) + (concat prefix subject suffix)))))) (defun shimbun-mixi-make-from (object) (let ((class (mixi-object-class object))) (if (eq class 'mixi-news) (mixi-news-media object) - (let ((owner (mixi-object-owner object))) + (let ((owner (if (eq class 'mixi-log) + (mixi-log-friend object) + (mixi-object-owner object)))) (mixi-friend-nick owner))))) (defun shimbun-mixi-make-date (object) @@ -178,19 +185,21 @@ of mixi object." (defun shimbun-mixi-make-message-id (object) (let ((class (mixi-object-class object))) - (concat "<" - (format-time-string "%Y%m%d%H%M" (mixi-object-time object)) "." - (if (eq class 'mixi-comment) - (concat (mixi-friend-id (mixi-comment-owner object)) "@" - (mixi-object-id (mixi-comment-parent object)) "." - (mixi-friend-id (mixi-object-owner - (mixi-comment-parent object))) ".") - (concat (mixi-object-id object) "@" - (if (eq class 'mixi-news) - (mixi-news-media-id object) - (mixi-object-id (mixi-object-owner object))) ".")) - (mixi-object-name object) ".mixi.jp" - ">"))) + (concat + (format-time-string "<%Y%m%d%H%M" (mixi-object-time object)) "." + (cond ((eq class 'mixi-comment) + (concat (mixi-friend-id (mixi-comment-owner object)) "@" + (mixi-object-id (mixi-comment-parent object)) "." + (mixi-friend-id (mixi-object-owner + (mixi-comment-parent object))) ".")) + ((eq class 'mixi-log) + (concat (mixi-friend-id (mixi-log-friend object)) "@")) + (t + (concat (mixi-object-id object) "@" + (if (eq class 'mixi-news) + (mixi-news-media-id object) + (mixi-object-id (mixi-object-owner object))) "."))) + (mixi-object-name object) ".mixi.jp>"))) (defun shimbun-mixi-make-xref (object) (let ((class (mixi-object-class object))) @@ -206,7 +215,11 @@ of mixi object." ((eq class 'mixi-message) (mixi-expand-url (mixi-message-page object))) ((eq class 'mixi-news) - (mixi-news-page object))))) + (mixi-news-page object)) + ((eq class 'mixi-log) + (mixi-expand-url (mixi-friend-page (mixi-log-friend object)))) + ((eq class 'mixi-friend) + (mixi-expand-url (mixi-friend-page object)))))) (defun shimbun-mixi-make-body (object) (let ((class (mixi-object-class object))) @@ -215,16 +228,57 @@ of mixi object." (setq limit (if limit (format-time-string "%Yǯ%m·î%dÆü" limit) "»ØÄê¤Ê¤·")) - (concat "
³«ºÅÆü»þ¡§
" - "
" (mixi-event-date object) "
" + (concat "
" + "
³«ºÅÆü»þ¡§
" + "
" (mixi-event-date object) "
\n" "
³«ºÅ¾ì½ê¡§
" - "
" (mixi-event-place object) "
" + "
" (mixi-event-place object) "
\n" "
¾ÜºÙ¡§
" - "
" (mixi-event-detail object) "
" + "
" (mixi-event-detail object) "
\n" "
Ê罸´ü¸Â¡§
" - "
" limit "
" + "
" limit "
\n" "
»²²Ã¼Ô¡§
" - "
" (mixi-event-members object) "
"))) + "
" (mixi-event-members object) "
\n" + "
"))) + ((eq class 'mixi-friend) + (if (mixi-object-realized-p object) + (let ((sex (if (eq (mixi-friend-sex object) 'male) "ÃË" "½÷")) + (age (number-to-string (mixi-friend-age object))) + (birthday + (concat (mapconcat (lambda (number) + (number-to-string number)) + (mixi-friend-birthday object) "·î") + "Æü")) + (blood-type (symbol-name + (mixi-friend-blood-type object))) + (hobby (mapconcat 'identity + (mixi-friend-hobby object) ", "))) + (concat "
" + "
̾Á°¡§
" + "
" (mixi-friend-name object) "
\n" + "
À­ÊÌ¡§
" + "
" sex "À­
\n" + "
¸½½»½ê¡§
" + "
" (mixi-friend-address object) "
\n" + "
ǯÎð¡§
" + "
" age "ºÐ
\n" + "
ÃÂÀ¸Æü¡§
" + "
" birthday "
\n" + "
·ì±Õ·¿¡§
" + "
" blood-type "·¿
\n" + "
½Ð¿ÈÃÏ¡§
" + "
" (mixi-friend-birthplace object) "
\n" + "
¼ñÌ£¡§
" + "
" hobby "
\n" + "
¿¦¶È¡§
" + "
" (mixi-friend-job object) "
\n" + "
½ê°¡§
" + "
" (mixi-friend-organization object) "
\n" + "
¼«¸Ê¾Ò²ð¡§
" + "
" (mixi-friend-profile object) "
\n" + "
")) + (concat "¥×¥í¥Õ¥£¡¼¥ë¤òɽ¼¨¤¹¤ë"))) (t (mixi-object-content object))))) (defun shimbun-mixi-make-reply-to (object)