(mixi-recommended-friend-list-page): New macro.
authorbg66 <bg66>
Wed, 26 Dec 2007 09:53:04 +0000 (09:53 +0000)
committerbg66 <bg66>
Wed, 26 Dec 2007 09:53:04 +0000 (09:53 +0000)
(mixi-recommended-friend-list-regexp): New constant.
(mixi-get-recommended-friends): New function.
(mixi-recommended-community-list-page): New alias.
(mixi-recommended-community-list-regexp): New constant.
(mixi-get-recommended-communities): New function.

ChangeLog
mixi-ja.texi
mixi.el

index a6f4105..fafa1b1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-12-26  OHASHI Akira  <bg66@koka-in.org>
+
+       * mixi.el (mixi-recommended-friend-list-page): New macro.
+       (mixi-recommended-friend-list-regexp): New constant.
+       (mixi-get-recommended-friends): New function.
+       (mixi-recommended-community-list-page): New alias.
+       (mixi-recommended-community-list-regexp): New constant.
+       (mixi-get-recommended-communities): New function.
+
 2007-12-21  OHASHI Akira  <bg66@koka-in.org>
 
        * configure.ac: Use modern AC_INIT.
index 706ec7d..f610765 100755 (executable)
@@ -755,6 +755,23 @@ 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-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
+@var{range} \e$B$r;XDj$7$?>l9g$O:GBg$G$3$N?t$N$*$9$9$a%^%$%_%/%7%#$N$_$r<hF@\e(B
+\e$B$7$^$9!#\e(B
+
+@cartouche
+@example
+(mixi-get-recommended-friends)
+    @result{} \e$B$*$9$9$a%^%$%_%/%7%#$9$Y$F\e(B
+
+(mixi-get-recommended-friends 5)
+    @result{} \e$B$*$9$9$a%^%$%_%/%7%#:GBg$G\e(B 5 \e$B7oJ,$N$_\e(B
+@end example
+@end cartouche
+@end defun
+
 @defun mixi-get-diaries &rest friend-or-range
 \e$BF|5-0lMw$r<hF@$7$^$9!#\e(B
 @var{friend-or-range} \e$B$O\e(B friend \e$B%*%V%8%'%/%H$^$?$O?tCM$r;XDj$9$k$3$H$,$G\e(B
@@ -860,6 +877,23 @@ 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-recommended-communities &optional range
+\e$B$*$9$9$a%3%_%e%K%F%#0lMw$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$*$9$9$a%3%_%e%K%F%#$N$_$r<hF@\e(B
+\e$B$7$^$9!#\e(B
+
+@cartouche
+@example
+(mixi-get-recommended-communities)
+    @result{} \e$B$*$9$9$a%3%_%e%K%F%#$9$Y$F\e(B
+
+(mixi-get-recommended-communities 5)
+    @result{} \e$B$*$9$9$a%3%_%e%K%F%#:GBg$G\e(B 5 \e$B7oJ,$N$_\e(B
+@end example
+@end cartouche
+@end defun
+
 @defun mixi-get-bbses community &optional range
 \e$B7G<(HD\e(B (\e$B%H%T%C%/\e(B/\e$B%$%Y%s%H\e(B) \e$B0lMw$r<hF@$7$^$9!#\e(B
 @var{community} \e$B$O\e(B community \e$B%*%V%8%'%/%H$r;XDj$7$F$/$@$5$$!#\e(B
diff --git a/mixi.el b/mixi.el
index 9c2d96a..4f708cf 100644 (file)
--- a/mixi.el
+++ b/mixi.el
 ;;  * mixi-get-friends
 ;;  * mixi-get-favorites
 ;;  * mixi-get-logs
+;;  * mixi-get-recommended-friends (indies)
 ;;  * mixi-get-diaries
 ;;  * mixi-get-new-diaries
 ;;  * mixi-search-diaries
 ;;  * mixi-get-communities
 ;;  * mixi-search-communities
+;;  * mixi-get-recommended-communities (indies)
 ;;  * mixi-get-bbses
 ;;  * mixi-get-new-bbses
 ;;  * mixi-search-bbses
   (autoload 'w3m-retrieve "w3m")
   (autoload 'url-retrieve-synchronously "url"))
 
-(defconst mixi-revision "$Revision: 1.177 $")
+(defconst mixi-revision "$Revision: 1.178 $")
 
 (defgroup mixi nil
   "API library for accessing to mixi."
@@ -1147,6 +1149,23 @@ Increase this value when unexpected error frequently occurs."
                                          (string-to-number (nth 0 item)))))
            items)))
 
+;; Recommended friend.
+(defmacro mixi-recommended-friend-list-page ()
+  `(concat "http://indies.mixi.jp/recommend.pl"))
+
+(defconst mixi-recommended-friend-list-regexp
+  "<div class=\"iconListImage\"><a href=\"http://mixi\\.jp/show_friend\\.pl\\?id=\\([0-9]+\\)\" [^>]+>.+</a></div><span>\\(.+?\\)¤µ¤ó([0-9]+)</span>")
+
+;;;###autoload
+(defun mixi-get-recommended-friends (&optional range)
+  "Get recommended friends."
+  (let ((items (mixi-get-matched-items (mixi-recommended-friend-list-page)
+                                      mixi-recommended-friend-list-regexp
+                                      range)))
+    (mapcar (lambda (item)
+             (mixi-make-friend (nth 0 item) (nth 1 item)))
+           items)))
+
 ;; Diary object.
 (defvar mixi-diary-cache (make-hash-table :test 'equal))
 (defun mixi-make-diary (owner id &optional comment-count time title content)
@@ -1701,6 +1720,23 @@ Increase this value when unexpected error frequently occurs."
              (mixi-make-community (nth 0 item) (nth 1 item)))
            items)))
 
+;; Recommended community.
+(defalias 'mixi-recommended-community-list-page
+  'mixi-recommended-friend-list-page)
+
+(defconst mixi-recommended-community-list-regexp
+  "<div class=\"iconListImage\"><a href=\"http://mixi\\.jp/view_community\\.pl\\?id=\\([0-9]+\\)\" [^>]+>.+</a></div><span>\\(.+\\)([0-9]+)</span>")
+
+;;;###autoload
+(defun mixi-get-recommended-communities (&optional range)
+  "Get recommended communities."
+  (let ((items (mixi-get-matched-items (mixi-recommended-community-list-page)
+                                      mixi-recommended-community-list-regexp
+                                      range)))
+    (mapcar (lambda (item)
+             (mixi-make-community (nth 0 item) (nth 1 item)))
+           items)))
+
 ;; Topic object.
 (defvar mixi-topic-cache (make-hash-table :test 'equal))
 (defun mixi-make-topic (community id &optional comment-count time title owner