* mixi.el (mixi-favorite-list-id-regexp): Abolish.
authorbg66 <bg66>
Thu, 1 Mar 2007 13:43:27 +0000 (13:43 +0000)
committerbg66 <bg66>
Thu, 1 Mar 2007 13:43:27 +0000 (13:43 +0000)
(mixi-favorite-list-nick-regexp): Ditto.
(mixi-favorite-list-regexp): New regexp.
(mixi-get-favorites): Follow the change above.

ChangeLog
mixi.el

index 342bba6..3c47a9c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,15 @@
+2007-03-01  OHASHI Akira  <bg66@koka-in.org>
+
+       * mixi.el (mixi-favorite-list-id-regexp): Abolish.
+       (mixi-favorite-list-nick-regexp): Ditto.
+       (mixi-favorite-list-regexp): New regexp.
+       (mixi-get-favorites): Follow the change above.
+
 2007-02-23  OHASHI Akira  <bg66@koka-in.org>
 
        * mixi-atom.el: New file.
        * Makefile.am (MODULES_MIXI): Add it.
-       
+
        * mixi-utils.el (mixi-make-content): Support mixi-log object.
 
        * mixi.el (mixi-url-encode-string): New function.
 
        * sb-mixi.el (shimbun-mixi-make-subject): Follow the change above.
        (shimbun-mixi-make-body): Ditto.
-       
+
 2006-11-27  OHASHI Akira  <bg66@koka-in.org>
 
        * mixi.el (mixi-event-cache): New variable.
diff --git a/mixi.el b/mixi.el
index c4e5c81..8b3a4d5 100644 (file)
--- a/mixi.el
+++ b/mixi.el
@@ -1068,28 +1068,19 @@ Increase this value when unexpected error frequently occurs."
 (defmacro mixi-favorite-list-page ()
   `(concat "/list_bookmark.pl?page=%d"))
 
-(defconst mixi-favorite-list-id-regexp
-  "<td ALIGN=center BGCOLOR=#FDF9F2 width=330><a href=\"show_friend\\.pl\\?id=\\([0-9]+\\)\">")
-(defconst mixi-favorite-list-nick-regexp
-  "<td BGCOLOR=#FDF9F2><font COLOR=#996600>̾&nbsp;&nbsp;Á°</font></td>
-<td COLSPAN=2 BGCOLOR=#FFFFFF>\\(.+\\)</td></tr>")
+(defconst mixi-favorite-list-regexp
+  "<td bgcolor=\"#FDF9F2\"><font color=\"#996600\">̾Á°</font></td>
+<td colspan=\"2\" bgcolor=\"#FFFFFF\"><a href=\"show_friend.pl\\?id=\\([0-9]+\\)\">\\(.*\\)</a></td>")
 
 ;;;###autoload
 (defun mixi-get-favorites (&optional range)
   "Get favorites."
-  (let ((ids (mixi-get-matched-items (mixi-favorite-list-page)
-                                    mixi-favorite-list-id-regexp
-                                    range))
-       (nicks (mixi-get-matched-items (mixi-favorite-list-page)
-                                      mixi-favorite-list-nick-regexp
+  (let ((items (mixi-get-matched-items (mixi-favorite-list-page)
+                                      mixi-favorite-list-regexp
                                       range)))
-    (let ((index 0)
-         ret)
-      (while (< index (length ids))
-       (setq ret (cons (mixi-make-friend (nth 0 (nth index ids))
-                                         (nth 0 (nth index nicks))) ret))
-       (incf index))
-      (reverse ret))))
+    (mapcar (lambda (item)
+             (mixi-make-friend (nth 0 item) (nth 1 item)))
+           items)))
 
 ;; Log object.
 (defun mixi-make-log (friend time)