From 6760587c1526fcfbb1f165c4d7152f13903141d6 Mon Sep 17 00:00:00 2001 From: bg66 Date: Thu, 7 Aug 2008 14:26:50 +0000 Subject: [PATCH] (mixi-get-friends): Follow the change of mixi. (mixi-my-friend-list-page): New function. (mixi-friend-list-page): Change from macro to function. (mixi-my-friend-list-nick-regexp): New constant. (mixi-friend-list-nick-regexp): Fix regexp. --- ChangeLog | 8 ++++++++ mixi.el | 44 +++++++++++++++++++++++++++----------------- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8b13054..6971cd7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-08-07 OHASHI Akira + + * mixi.el (mixi-get-friends): Follow the change of mixi. + (mixi-my-friend-list-page): New function. + (mixi-friend-list-page): Change from macro to function. + (mixi-my-friend-list-nick-regexp): New constant. + (mixi-friend-list-nick-regexp): Fix regexp. + 2008-08-05 OHASHI Akira * sb-mixi.el (shimbun-mixi-default-group-alist): Add echo group. diff --git a/mixi.el b/mixi.el index 80491ea..a9e04ff 100644 --- a/mixi.el +++ b/mixi.el @@ -142,7 +142,7 @@ (autoload 'w3m-retrieve "w3m") (autoload 'url-retrieve-synchronously "url")) -(defconst mixi-revision "$Revision: 1.191 $") +(defconst mixi-revision "$Revision: 1.192 $") (defgroup mixi nil "API library for accessing to mixi." @@ -1058,12 +1058,16 @@ Increase this value when unexpected error frequently occurs." (signal 'wrong-type-argument (list 'mixi-friend-p friend))) (aset (cdr friend) 13 profile)) -(defmacro mixi-friend-list-page (&optional friend) - `(concat "/list_friend.pl?page=%d" - (when ,friend (concat "&id=" (mixi-friend-id ,friend))))) +(defun mixi-my-friend-list-page (&optional dummy) + (concat "/list_friend_simple.pl?page=%d")) + +(defun mixi-friend-list-page (friend) + (concat "/list_friend.pl?page=%d&id=" (mixi-friend-id friend))) (defconst mixi-friend-list-id-regexp "\\(.+\\)([0-9]+)

") (defconst mixi-friend-list-nick-regexp "\\(.+\\)¤µ¤ó([0-9]+)") @@ -1080,19 +1084,25 @@ Increase this value when unexpected error frequently occurs." (setq range (nth 0 friend-or-range))) (unless (or (null friend) (mixi-friend-p friend)) (signal 'wrong-type-argument (list 'mixi-friend-p friend))) - (let ((ids (mixi-get-matched-items (mixi-friend-list-page friend) - mixi-friend-list-id-regexp - range)) - (nicks (mixi-get-matched-items (mixi-friend-list-page friend) - mixi-friend-list-nick-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))))) + (let (list-page list-nick-regexp) + (if (or (null friend) (equal friend mixi-me)) + (setq list-page 'mixi-my-friend-list-page + list-nick-regexp mixi-my-friend-list-nick-regexp) + (setq list-page 'mixi-friend-list-page + list-nick-regexp mixi-friend-list-nick-regexp)) + (let ((ids (mixi-get-matched-items (funcall list-page friend) + mixi-friend-list-id-regexp + range)) + (nicks (mixi-get-matched-items (funcall list-page friend) + list-nick-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)))))) ;; Favorite. (defmacro mixi-favorite-list-page () -- 1.7.10.4