From 6cee24df2e4c78ab9f9143c8268e185874821f9a Mon Sep 17 00:00:00 2001 From: bg66 Date: Sun, 22 Oct 2006 07:32:41 +0000 Subject: [PATCH] * 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. --- ChangeLog | 20 +++++++++++++++++++ mixi.el | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 81 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3548050..d81a08e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,25 @@ 2006-10-22 OHASHI Akira + * 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 + * 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 --- 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." "´ÉÍý¿Í\n\n\n\n\\(.+\\)") (defconst mixi-community-category-regexp "¥«¥Æ¥´¥ê\n\\([^<]+\\)") +(defconst mixi-community-members-regexp + "¥á¥ó¥Ð¡¼¿ô\n\\([0-9]+\\)¿Í") +(defconst mixi-community-open-level-regexp + "»²²Ã¾ò·ï¤È
¸ø³«¥ì¥Ù¥ë
+\\(.+\\)") +(defconst mixi-community-authority-regexp + "¥È¥Ô¥Ã¥¯ºîÀ®¤Î¸¢¸Â\n\\(.+\\)") (defconst mixi-community-description-regexp "\\(.+\\)") @@ -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" -- 1.7.10.4