* mixi.el (mixi-make-community): New slot `members'.
authorbg66 <bg66>
Sun, 22 Oct 2006 07:32:41 +0000 (07:32 +0000)
committerbg66 <bg66>
Sun, 22 Oct 2006 07:32:41 +0000 (07:32 +0000)
(mixi-community-members): New accessor method.
(mixi-community-set-members): Ditto.
(mixi-community-members-regexp): New constant.
(mixi-community-realize): Use them.

* mixi.el (mixi-make-community): New slot `open level'.
(mixi-community-open-level): New accessor method.
(mixi-community-set-open-level): Ditto.
(mixi-community-open-level-regexp): New constant.
(mixi-community-realize): Use them.

* mixi.el (mixi-make-community): New slot `authority'.
(mixi-community-authority): New accessor method.
(mixi-community-set-authority): Ditto.
(mixi-community-authority-regexp): New constant.
(mixi-community-realize): Use them.

ChangeLog
mixi.el

index 3548050..d81a08e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
 2006-10-22  OHASHI Akira  <bg66@koka-in.org>
 
+       * mixi.el (mixi-make-community): New slot `members'.
+       (mixi-community-members): New accessor method.
+       (mixi-community-set-members): Ditto.
+       (mixi-community-members-regexp): New constant.
+       (mixi-community-realize): Use them.
+
+       * mixi.el (mixi-make-community): New slot `open level'.
+       (mixi-community-open-level): New accessor method.
+       (mixi-community-set-open-level): Ditto.
+       (mixi-community-open-level-regexp): New constant.
+       (mixi-community-realize): Use them.
+
+       * mixi.el (mixi-make-community): New slot `authority'.
+       (mixi-community-authority): New accessor method.
+       (mixi-community-set-authority): Ditto.
+       (mixi-community-authority-regexp): New constant.
+       (mixi-community-realize): Use them.
+
+2006-10-22  OHASHI Akira  <bg66@koka-in.org>
+
        * mixi.el (mixi-make-friend): New slot `sex'.
        (mixi-friend-sex): New accessor method.
        (mixi-friend-set-sex): Ditto.
diff --git a/mixi.el b/mixi.el
index f147382..62900a9 100644 (file)
--- a/mixi.el
+++ b/mixi.el
@@ -848,7 +848,7 @@ while `mixi' is waiting for a server's response."
 (defun mixi-make-community (id &optional name)
   "Return a community object."
   (mixi-make-cache id (cons 'mixi-community (vector nil id name nil nil nil
-                                                   nil))
+                                                   nil nil nil nil))
                   mixi-community-cache))
 
 (defmacro mixi-community-p (community)
@@ -869,6 +869,13 @@ while `mixi' is waiting for a server's response."
   "<td BGCOLOR=#F2DDB7><font COLOR=#996600>´ÉÍý¿Í</font></td>\n<td>\n\n<a href=\"\\(home\\.pl\\|show_friend\\.pl\\?id=\\([0-9]+\\)\\)\">\n\\(.+\\)</a>")
 (defconst mixi-community-category-regexp
   "<td BGCOLOR=#F2DDB7><font COLOR=#996600>¥«¥Æ¥´¥ê</font></td>\n<td>\\([^<]+\\)</td>")
+(defconst mixi-community-members-regexp
+  "<td BGCOLOR=#F2DDB7><font COLOR=#996600>¥á¥ó¥Ð¡¼¿ô</font></td>\n<td>\\([0-9]+\\)¿Í</td></tr>")
+(defconst mixi-community-open-level-regexp
+  "<td BGCOLOR=#F2DDB7><font COLOR=#996600>»²²Ã¾ò·ï¤È<br>¸ø³«¥ì¥Ù¥ë</font></td>
+<td>\\(.+\\)</td></tr>")
+(defconst mixi-community-authority-regexp
+  "<td BGCOLOR=#F2DDB7><font COLOR=#996600>¥È¥Ô¥Ã¥¯ºîÀ®¤Î¸¢¸Â</font></td>\n<td>\\(.+\\)</td></tr>")
 (defconst mixi-community-description-regexp
   "<td CLASS=h120>\\(.+\\)</td>")
 
@@ -901,8 +908,19 @@ while `mixi' is waiting for a server's response."
        (if (string-match mixi-community-category-regexp buffer)
            (mixi-community-set-category community (match-string 1 buffer))
          (signal 'error (list 'cannot-find-category community)))
+       (if (string-match mixi-community-members-regexp buffer)
+           (mixi-community-set-members
+            community (string-to-number (match-string 1 buffer)))
+         (signal 'error (list 'cannot-find-members community)))
+       (if (string-match mixi-community-open-level-regexp buffer)
+           (mixi-community-set-open-level community (match-string 1 buffer))
+         (signal 'error (list 'cannot-find-open-level community)))
+       (if (string-match mixi-community-authority-regexp buffer)
+           (mixi-community-set-authority community (match-string 1 buffer))
+         (signal 'error (list 'cannot-find-authority community)))
        (if (string-match mixi-community-description-regexp buffer)
-           (mixi-community-set-description community (match-string 1 buffer))
+           (mixi-community-set-description
+            community (mixi-remove-markup (match-string 1 buffer)))
          (signal 'error (list 'cannot-find-description community)))))
     (mixi-community-touch community)))
 
@@ -947,12 +965,33 @@ while `mixi' is waiting for a server's response."
   (mixi-community-realize community)
   (aref (cdr community) 5))
 
+(defun mixi-community-members (community)
+  "Return the members of COMMUNITY."
+  (unless (mixi-community-p community)
+    (signal 'wrong-type-argument (list 'mixi-community-p community)))
+  (mixi-community-realize community)
+  (aref (cdr community) 6))
+
+(defun mixi-community-open-level (community)
+  "Return the open-level of COMMUNITY."
+  (unless (mixi-community-p community)
+    (signal 'wrong-type-argument (list 'mixi-community-p community)))
+  (mixi-community-realize community)
+  (aref (cdr community) 7))
+
+(defun mixi-community-authority (community)
+  "Return the authority of COMMUNITY."
+  (unless (mixi-community-p community)
+    (signal 'wrong-type-argument (list 'mixi-community-p community)))
+  (mixi-community-realize community)
+  (aref (cdr community) 8))
+
 (defun mixi-community-description (community)
   "Return the description of COMMUNITY."
   (unless (mixi-community-p community)
     (signal 'wrong-type-argument (list 'mixi-community-p community)))
   (mixi-community-realize community)
-  (aref (cdr community) 6))
+  (aref (cdr community) 9))
 
 (defun mixi-community-touch (community)
   "Set the timestamp of COMMUNITY."
@@ -986,11 +1025,29 @@ while `mixi' is waiting for a server's response."
     (signal 'wrong-type-argument (list 'mixi-community-p community)))
   (aset (cdr community) 5 category))
 
+(defun mixi-community-set-members (community members)
+  "Set the name of COMMUNITY."
+  (unless (mixi-community-p community)
+    (signal 'wrong-type-argument (list 'mixi-community-p community)))
+  (aset (cdr community) 6 members))
+
+(defun mixi-community-set-open-level (community open-level)
+  "Set the name of COMMUNITY."
+  (unless (mixi-community-p community)
+    (signal 'wrong-type-argument (list 'mixi-community-p community)))
+  (aset (cdr community) 7 open-level))
+
+(defun mixi-community-set-authority (community authority)
+  "Set the name of COMMUNITY."
+  (unless (mixi-community-p community)
+    (signal 'wrong-type-argument (list 'mixi-community-p community)))
+  (aset (cdr community) 8 authority))
+
 (defun mixi-community-set-description (community description)
   "Set the name of COMMUNITY."
   (unless (mixi-community-p community)
     (signal 'wrong-type-argument (list 'mixi-community-p community)))
-  (aset (cdr community) 6 description))
+  (aset (cdr community) 9 description))
 
 (defmacro mixi-community-list-page (&optional friend)
   `(concat "/list_community.pl?page=%d"