From: bg66 Date: Mon, 11 Dec 2006 03:14:48 +0000 (+0000) Subject: * mixi.el (mixi-search-community-list-page): New macro. X-Git-Tag: mixi-el-1_0_0~167 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6bf71d1dc7a248f714268f0c18b3feee4d85ff52;p=elisp%2Fmixi.git * mixi.el (mixi-search-community-list-page): New macro. (mixi-search-community-list-regexp): New regexp. (mixi-search-communities): New function. --- diff --git a/ChangeLog b/ChangeLog index 8d3fef1..ded4967 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2006-12-11 OHASHI Akira + * mixi.el (mixi-search-community-list-page): New macro. + (mixi-search-community-list-regexp): New regexp. + (mixi-search-communities): New function. + +2006-12-11 OHASHI Akira + * mixi.el (mixi-cache-expires): Set the default value to nil. 2006-12-08 OHASHI Akira diff --git a/mixi.el b/mixi.el index 53ae4d5..c637213 100644 --- a/mixi.el +++ b/mixi.el @@ -33,6 +33,7 @@ ;; * mixi-get-new-diaries ;; * mixi-search-diaries ;; * mixi-get-communities +;; * mixi-search-communities ;; * mixi-get-bbses ;; * mixi-get-new-bbses ;; * mixi-get-comments @@ -1342,6 +1343,26 @@ Increase this value when unexpected error frequently occurs." (incf index)) (reverse ret))))) +(defmacro mixi-search-community-list-page (keyword) + `(concat "/search_community.pl?page=%d&&sort=date&type=com&submit=main" + "&keyword=" (mixi-url-encode-and-quote-percent-string keyword) + "&category_id=0")) + +(defconst mixi-search-community-list-regexp + " +¥³¥ß¥å¥Ë¥Æ¥£Ì¾ +\\([^<]+\\)") + +;; FIXME: Support category. +(defun mixi-search-communities (keyword &optional range) + (let ((items (mixi-get-matched-items (mixi-search-community-list-page + keyword) + mixi-search-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)