\\(.*\\)
")
(defconst mixi-community-birthday-regexp
"
³«ÀßÆü
@@ -1488,7 +1556,7 @@ Increase this value when unexpected error frequently occurs."
(defun mixi-realize-community (community)
"Realize a COMMUNITY."
- ;; FIXME: Check a expiration of cache?
+ ;; FIXME: Check an expiration of cache?
(unless (mixi-object-realized-p community)
(with-mixi-retrieve (mixi-community-page community)
(let ((case-fold-search t))
@@ -1698,6 +1766,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
+ "
\\(.+\\)([0-9]+)")
+
+;;;###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
@@ -1740,7 +1825,7 @@ Increase this value when unexpected error frequently occurs."
(defun mixi-realize-topic (topic &optional page)
"Realize a TOPIC."
- ;; FIXME: Check a expiration of cache?
+ ;; FIXME: Check an expiration of cache?
(unless (mixi-object-realized-p topic)
(with-mixi-retrieve (or page (mixi-topic-page topic))
(if (re-search-forward mixi-topic-community-regexp nil t)
@@ -1868,7 +1953,8 @@ Increase this value when unexpected error frequently occurs."
(mixi-post-error 'cannot-find-key community)))
(setq fields `(("post_key" . ,post-key)
("bbs_title" . ,title)
- ("bbs_body" . ,content)
+ ("bbs_body" . ,(mixi-replace-tab-and-space-to-nbsp
+ content))
("submit" . "confirm")))
(with-mixi-post-form (mixi-post-topic-page community) fields
(unless (re-search-forward mixi-post-succeed-regexp nil t)
@@ -1917,9 +2003,9 @@ Increase this value when unexpected error frequently occurs."
"
³«ºÅ¾ì½ê
\\(.+\\)")
(defconst mixi-event-owner-regexp
- "
\\(.*\\)")
+ "
\\((mixi Âà²ñºÑ)\\|\\(.*\\)\\)")
(defconst mixi-event-owner-seceded-regexp
- "
\\((mixi Âà²ñºÑ)\\)")
+ "(mixi Âà²ñºÑ)")
(defconst mixi-event-detail-regexp
"
\\(\\(.\\|\r?\n\\)*?\\)
")
@@ -1932,7 +2018,7 @@ Increase this value when unexpected error frequently occurs."
(defun mixi-realize-event (event &optional page)
"Realize a EVENT."
- ;; FIXME: Check a expiration of cache?
+ ;; FIXME: Check an expiration of cache?
(unless (mixi-object-realized-p event)
(with-mixi-retrieve (or page (mixi-event-page event))
(let ((case-fold-search t))
@@ -1958,12 +2044,14 @@ Increase this value when unexpected error frequently occurs."
(mixi-event-set-place event (match-string 1))
(mixi-realization-error 'cannot-find-place event))
(if (re-search-forward mixi-event-owner-regexp nil t)
- (mixi-event-set-owner event (mixi-make-friend (match-string 1)
- (match-string 2)))
- (if (re-search-forward mixi-event-owner-seceded-regexp nil t)
- (mixi-event-set-owner event
- (mixi-make-friend nil (match-string 1)))
- (mixi-realization-error 'cannot-find-owner event)))
+ (let ((seceded-or-not (match-string 1))
+ (id (match-string 2))
+ (nick (match-string 3)))
+ (if (string= mixi-event-owner-seceded-regexp seceded-or-not)
+ (mixi-event-set-owner event
+ (mixi-make-friend nil seceded-or-not))
+ (mixi-event-set-owner event (mixi-make-friend id nick))))
+ (mixi-realization-error 'cannot-find-owner event))
(if (re-search-forward mixi-event-detail-regexp nil t)
(mixi-event-set-detail event (match-string 1))
(mixi-realization-error 'cannot-find-detail event))
@@ -2150,7 +2238,7 @@ Increase this value when unexpected error frequently occurs."
;;;###autoload
(defun mixi-get-bbses (community &optional range)
- "Get bbese of COMMUNITY."
+ "Get bbses of COMMUNITY."
(unless (mixi-community-p community)
(signal 'wrong-type-argument (list 'mixi-community-p community)))
(let ((items (mixi-get-matched-items (mixi-bbs-list-page community)
@@ -2230,9 +2318,9 @@ Increase this value when unexpected error frequently occurs."
(funcall func parent page)))
;; Comment object.
-(defun mixi-make-comment (parent owner time content)
+(defun mixi-make-comment (parent owner time content &optional count)
"Return a comment object."
- (cons 'mixi-comment (vector parent owner time content)))
+ (cons 'mixi-comment (vector parent owner time content count)))
(defmacro mixi-comment-p (comment)
`(eq (mixi-object-class ,comment) 'mixi-comment))
@@ -2261,6 +2349,12 @@ Increase this value when unexpected error frequently occurs."
(signal 'wrong-type-argument (list 'mixi-comment-p comment)))
(aref (cdr comment) 3))
+(defun mixi-comment-count (comment)
+ "Return the count of COMMENT."
+ (unless (mixi-comment-p comment)
+ (signal 'wrong-type-argument (list 'mixi-comment-p comment)))
+ (aref (cdr comment) 4))
+
(defun mixi-diary-comment-list-page (diary)
(concat "/view_diary.pl?full=1"
"&id=" (mixi-diary-id diary)
@@ -2270,29 +2364,18 @@ Increase this value when unexpected error frequently occurs."
(defconst mixi-diary-comment-list-regexp
"
-
+\\(
+|
¼«Ê¬¤Î¥³¥á¥ó¥È¤òºï½ü¤¹¤ë
+\\|\\)
+*
-
-
-?
-
-
-
-
-
-
-
-
-
-
-
-
-?
+*
-\\(.+\\)
-")
+\\(\\(.\\|\r?\n\\)*?\\)
+
+
+
")
(defun mixi-topic-comment-list-page (topic)
(concat "/view_bbs.pl?page=all"
@@ -2301,7 +2384,8 @@ Increase this value when unexpected error frequently occurs."
;; FIXME: Split regexp to time, owner(id and nick) and contents.
(defconst mixi-topic-comment-list-regexp
- "