* mixi.el (mixi-log-list-regexp): Follow the change of mixi.
authorbg66 <bg66>
Thu, 8 Jan 2009 05:47:40 +0000 (05:47 +0000)
committerbg66 <bg66>
Thu, 8 Jan 2009 05:47:40 +0000 (05:47 +0000)
(mixi-log-list-page): Change to the constant from macro.
(mixi-get-logs-internal): New function.
(mixi-get-logs): Follow the change above.
(mixi-log-self-list-page): New constant.
(mixi-get-self-logs): New function.
* sb-mixi.el (shimbun-mixi-default-group-alist): Add `logs.self'.

ChangeLog
mixi-ja.texi
mixi.el
sb-mixi.el

index a4800d4..7ed111c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-01-08  OHASHI Akira  <bg66@koka-in.org>
+
+       * mixi.el (mixi-log-list-regexp): Follow the change of mixi.
+       (mixi-log-list-page): Change to the constant from macro.
+       (mixi-get-logs-internal): New function.
+       (mixi-get-logs): Follow the change above.
+       (mixi-log-self-list-page): New constant.
+       (mixi-get-self-logs): New function.
+       * sb-mixi.el (shimbun-mixi-default-group-alist): Add `logs.self'.
+
 2008-12-26  OHASHI Akira  <bg66@koka-in.org>
 
        * mixi.el (mixi-replace-tab-and-space-to-nbsp): New user option.
index c14f355..8368acd 100755 (executable)
@@ -14,7 +14,7 @@
 @end direntry
 
 @copying
-Copyright @copyright{} 2007, 2008 @w{OHASHI Akira}.
+Copyright @copyright{} 2007, 2008, 2009 @w{OHASHI Akira}.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -815,6 +815,22 @@ friend \e$B%*%V%8%'%/%H$H?tCM$OF1;~$K;XDj$9$k$3$H$b$G$-$^$9!#\e(B
 @end cartouche
 @end defun
 
+@defun mixi-get-self-logs &optional range
+\e$B<+J,$NB-$"$H0lMw$r<hF@$7$^$9!#\e(B
+@var{range} \e$B$O?tCM$r;XDj$9$k$3$H$,$G$-$^$9!#\e(B
+@var{range} \e$B$r;XDj$7$?>l9g$O:GBg$G$3$N?t$N<+J,$NB-$"$H$N$_$r<hF@$7$^$9!#\e(B
+
+@cartouche
+@example
+(mixi-get-self-logs)
+    @result{} \e$B<+J,$NB-$"$H$9$Y$F\e(B
+
+(mixi-get-self-logs 5)
+    @result{} \e$B<+J,$NB-$"$H:GBg$G\e(B 5 \e$B7oJ,$N$_\e(B
+@end example
+@end cartouche
+@end defun
+
 @defun mixi-get-recommended-friends &optional range
 \e$B$*$9$9$a%^%$%_%/%7%#0lMw$r<hF@$7$^$9!#\e(B
 @var{range} \e$B$O?tCM$r;XDj$9$k$3$H$,$G$-$^$9!#\e(B
diff --git a/mixi.el b/mixi.el
index 426b276..cf8b1e6 100644 (file)
--- a/mixi.el
+++ b/mixi.el
@@ -1,6 +1,6 @@
 ;; mixi.el --- API libraries for accessing to mixi -*- coding: euc-jp -*-
 
-;; Copyright (C) 2005, 2006, 2007, 2008 OHASHI Akira
+;; Copyright (C) 2005, 2006, 2007, 2008, 2009 OHASHI Akira
 
 ;; Author: OHASHI Akira <bg66@koka-in.org>
 ;; Keywords: hypermedia
@@ -29,6 +29,7 @@
 ;;  * mixi-get-friends
 ;;  * mixi-get-favorites
 ;;  * mixi-get-logs
+;;  * mixi-get-self-logs
 ;;  * mixi-get-recommended-friends (indies)
 ;;  * mixi-get-diaries
 ;;  * mixi-get-new-diaries
   (autoload 'w3m-retrieve "w3m")
   (autoload 'url-retrieve-synchronously "url"))
 
-(defconst mixi-revision "$Revision: 1.202 $")
+(defconst mixi-revision "$Revision: 1.203 $")
 
 (defgroup mixi nil
   "API library for accessing to mixi."
@@ -1153,28 +1154,42 @@ Increase this value when unexpected error frequently occurs."
     (signal 'wrong-type-argument (list 'mixi-log-p log)))
   (aref (cdr log) 1))
 
-(defmacro mixi-log-list-page ()
-  `(concat "/show_log.pl"))
+(defconst mixi-log-list-page "/show_log.pl")
 
 (defconst mixi-log-list-regexp
-  "\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\) <a href=\"show_friend\\.pl\\?id=\\([0-9]+\\)\">\\(.*?\\)</a>")
+  "\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\)</span><span class=\"name\"><a href=\"show_friend\\.pl\\?id=\\([0-9]+\\)\">\\(.*?\\)</a>")
 
-;;;###autoload
-(defun mixi-get-logs (&optional range)
-  "Get logs."
-  (let ((items (mixi-get-matched-items (mixi-log-list-page)
+(defun mixi-get-logs-internal (list-page &optional range)
+  (let ((items (mixi-get-matched-items list-page
                                       mixi-log-list-regexp
-                                      range)))
+                                      range))
+       (year (nth 5 (decode-time (current-time))))
+       (month (nth 4 (decode-time (current-time)))))
     (mapcar (lambda (item)
-             (mixi-make-log (mixi-make-friend (nth 5 item) (nth 6 item))
-                            (encode-time 0
-                                         (string-to-number (nth 4 item))
-                                         (string-to-number (nth 3 item))
-                                         (string-to-number (nth 2 item))
-                                         (string-to-number (nth 1 item))
-                                         (string-to-number (nth 0 item)))))
+             (let ((month-of-item (string-to-number (nth 0 item))))
+               (when (> month-of-item month)
+                 (decf year))
+               (setq month month-of-item)
+               (mixi-make-log (mixi-make-friend (nth 4 item) (nth 5 item))
+                              (encode-time 0
+                                           (string-to-number (nth 3 item))
+                                           (string-to-number (nth 2 item))
+                                           (string-to-number (nth 1 item))
+                                           month year))))
            items)))
 
+;;;###autoload
+(defun mixi-get-logs (&optional range)
+  "Get logs."
+  (mixi-get-logs-internal mixi-log-list-page range))
+
+(defconst mixi-log-self-list-page "/show_self_log.pl")
+
+;;;###autoload
+(defun mixi-get-self-logs (&optional range)
+  "Get self logs."
+  (mixi-get-logs-internal mixi-log-self-list-page range))
+
 ;; Recommended friend.
 (defmacro mixi-recommended-friend-list-page ()
   `(concat "http://indies.mixi.jp/recommend.pl"))
index 43d0d72..2935f9c 100644 (file)
@@ -1,6 +1,6 @@
 ;;; sb-mixi.el --- shimbun backend for mixi
 
-;; Copyright (C) 2006, 2007, 2008 OHASHI Akira
+;; Copyright (C) 2006, 2007, 2008, 2009 OHASHI Akira
 
 ;; Author: OHASHI Akira <bg66@koka-in.org>
 ;; Keywords: news
@@ -33,7 +33,7 @@
 (require 'mixi-utils)
 (require 'shimbun)
 
-(defconst shimbun-mixi-revision "$Revision: 1.65 $")
+(defconst shimbun-mixi-revision "$Revision: 1.66 $")
 
 (eval-and-compile
   (luna-define-class shimbun-mixi (shimbun) (comment-cache release-cache))
@@ -53,6 +53,7 @@
      (lambda (range)
        (mixi-get-messages 'noticebox range)))
     ("logs" . mixi-get-logs)
+    ("logs.self" . mixi-get-self-logs)
     ("my-diaries" . "/home.pl")
     ("mixi-el" . "/view_community.pl?id=1596390")
     ("news.newest.domestic" .