* mixi.el (mixi-make-object-from-url): Support friend object.
authorbg66 <bg66>
Tue, 30 Jan 2007 01:12:24 +0000 (01:12 +0000)
committerbg66 <bg66>
Tue, 30 Jan 2007 01:12:24 +0000 (01:12 +0000)
(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.

ChangeLog
mixi.el
sb-mixi.el

index 280ea61..bb34c8f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2007-01-30  OHASHI Akira  <bg66@koka-in.org>
+
+       * 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  <bg66@koka-in.org>
 
        * sb-mixi.el (shimbun-mixi-group-alist): Add `messages.sent' and
diff --git a/mixi.el b/mixi.el
index 2e10f59..ac18a8f 100644 (file)
--- 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))))
index 8b2e77b..a346df2 100644 (file)
@@ -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 "<dl><dt>³«ºÅÆü»þ¡§</dt>"
-                    "<dd>" (mixi-event-date object) "</dd>"
+            (concat "<dl>"
+                    "<dt>³«ºÅÆü»þ¡§</dt>"
+                    "<dd>" (mixi-event-date object) "</dd>\n"
                     "<dt>³«ºÅ¾ì½ê¡§</dt>"
-                    "<dd>" (mixi-event-place object) "</dd>"
+                    "<dd>" (mixi-event-place object) "</dd>\n"
                     "<dt>¾ÜºÙ¡§</dt>"
-                    "<dd>" (mixi-event-detail object) "</dd>"
+                    "<dd>" (mixi-event-detail object) "</dd>\n"
                     "<dt>Ê罸´ü¸Â¡§</dt>"
-                    "<dd>" limit "</dd>"
+                    "<dd>" limit "</dd>\n"
                     "<dt>»²²Ã¼Ô¡§</dt>"
-                    "<dd>" (mixi-event-members object) "</dd></dl>")))
+                    "<dd>" (mixi-event-members object) "</dd>\n"
+                    "</dl>")))
+         ((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 "<dl>"
+                        "<dt>̾Á°¡§</dt>"
+                        "<dd>" (mixi-friend-name object) "</dd>\n"
+                        "<dt>À­ÊÌ¡§</dt>"
+                        "<dd>" sex "À­</dd>\n"
+                        "<dt>¸½½»½ê¡§</dt>"
+                        "<dd>" (mixi-friend-address object) "</dd>\n"
+                        "<dt>ǯÎð¡§</dt>"
+                        "<dd>" age "ºÐ</dd>\n"
+                        "<dt>ÃÂÀ¸Æü¡§</dt>"
+                        "<dd>" birthday "</dd>\n"
+                        "<dt>·ì±Õ·¿¡§</dt>"
+                        "<dd>" blood-type "·¿</dd>\n"
+                        "<dt>½Ð¿ÈÃÏ¡§</dt>"
+                        "<dd>" (mixi-friend-birthplace object) "</dd>\n"
+                        "<dt>¼ñÌ£¡§</dt>"
+                        "<dd>" hobby "</dd>\n"
+                        "<dt>¿¦¶È¡§</dt>"
+                        "<dd>" (mixi-friend-job object) "</dd>\n"
+                        "<dt>½ê°¡§</dt>"
+                        "<dd>" (mixi-friend-organization object) "</dd>\n"
+                        "<dt>¼«¸Ê¾Ò²ð¡§</dt>"
+                        "<dd>" (mixi-friend-profile object) "</dd>\n"
+                        "</dl>"))
+            (concat "<a href=\"" (shimbun-mixi-make-xref object)
+                    "\">¥×¥í¥Õ¥£¡¼¥ë¤òɽ¼¨¤¹¤ë</a>")))
          (t (mixi-object-content object)))))
 
 (defun shimbun-mixi-make-reply-to (object)