(mixi-diary-content-regexp): Follow the change of mixi.
[elisp/mixi.git] / mixi.el
diff --git a/mixi.el b/mixi.el
index 2c2f862..ab0ac2a 100644 (file)
--- a/mixi.el
+++ b/mixi.el
@@ -1,4 +1,4 @@
-;; mixi.el --- API libraries for accessing to mixi
+;; mixi.el --- API libraries for accessing to mixi -*- coding: euc-jp -*-
 
 ;; Copyright (C) 2005,2006 OHASHI Akira
 
 ;;       (buffer (get-buffer-create "*temp*"))
 ;;       (format "%Y/%m/%d %H:%M"))
 ;;   (pop-to-buffer buffer)
-;;   (mapc (lambda (diary)
-;;       (let ((subject (mixi-diary-title diary))
-;;             (from (mixi-friend-nick (mixi-diary-owner diary)))
-;;             (date (format-time-string format (mixi-diary-time diary)))
-;;             (body (mixi-remove-markup (mixi-diary-content diary))))
-;;         (insert "From: " from "\n"
-;;                 "Subject: " subject "\n"
-;;                 "Date: " date "\n\n"
-;;                 body "\n\n")))
-;;     (mixi-get-new-diaries range))
+;;   (let ((diaries (mixi-get-new-diaries range)))
+;;     (while diaries
+;;       (let* ((diary (car diaries))
+;;          (subject (mixi-diary-title diary))
+;;          (from (mixi-friend-nick (mixi-diary-owner diary)))
+;;          (date (format-time-string format (mixi-diary-time diary)))
+;;          (body (mixi-remove-markup (mixi-diary-content diary))))
+;;     (insert "From: " from "\n"
+;;             "Subject: " subject "\n"
+;;             "Date: " date "\n\n"
+;;             body "\n\n"))
+;;       (setq diaries (cdr diaries))))
 ;;   (set-buffer-modified-p nil)
 ;;   (setq buffer-read-only t)
 ;;   (goto-char (point-min)))
 ;;       (buffer (get-buffer-create "*temp*"))
 ;;       (format "%Y/%m/%d %H:%M"))
 ;;   (pop-to-buffer buffer)
-;;   (mapc (lambda (diary)
-;;       (let ((subject (mixi-diary-title diary))
-;;             (from (mixi-friend-nick (mixi-diary-owner diary)))
-;;             (date (format-time-string format (mixi-diary-time diary)))
-;;             (body (mixi-remove-markup (mixi-diary-content diary))))
-;;         (insert "From: " from "\n"
-;;                 "Subject: " subject "\n"
-;;                 "Date: " date "\n\n"
-;;                 body "\n\n")
-;;         (mapc (lambda (comment)
-;;                 (let ((from (mixi-friend-nick
-;;                              (mixi-comment-owner comment)))
-;;                       (subject (concat "Re: " subject))
-;;                       (date (format-time-string
-;;                              format (mixi-comment-time comment)))
-;;                       (body (mixi-remove-markup
-;;                              (mixi-comment-content comment))))
-;;                   (insert "From: " from "\n"
-;;                           "Subject: " subject "\n"
-;;                           "Date: " date "\n\n"
-;;                           body "\n\n")))
-;;               (mixi-get-comments diary range))))
-;;     (mixi-get-new-diaries range))
+;;   (let ((diaries (mixi-get-new-diaries range)))
+;;     (while diaries
+;;       (let* ((diary (car diaries))
+;;          (subject (mixi-diary-title diary))
+;;          (from (mixi-friend-nick (mixi-diary-owner diary)))
+;;          (date (format-time-string format (mixi-diary-time diary)))
+;;          (body (mixi-remove-markup (mixi-diary-content diary))))
+;;     (insert "From: " from "\n"
+;;             "Subject: " subject "\n"
+;;             "Date: " date "\n\n"
+;;             body "\n\n")
+;;     (let ((comments (mixi-get-comments diary range)))
+;;       (while comments
+;;         (let* ((comment (car comments))
+;;                (from (mixi-friend-nick (mixi-comment-owner comment)))
+;;                (subject (concat "Re: " subject))
+;;                (date (format-time-string format
+;;                                          (mixi-comment-time comment)))
+;;                (body (mixi-remove-markup (mixi-comment-content comment))))
+;;           (insert "From: " from "\n"
+;;                   "Subject: " subject "\n"
+;;                   "Date: " date "\n\n"
+;;                   body "\n\n"))
+;;         (setq comments (cdr comments)))))
+;;       (setq diaries (cdr diaries))))
 ;;   (set-buffer-modified-p nil)
 ;;   (setq buffer-read-only t)
 ;;   (goto-char (point-min)))
   (defvar url-request-method)
   (defvar url-request-data)
   (defvar url-request-extra-headers)
+  (defvar url-show-status)
   (autoload 'w3m-decode-buffer "w3m")
   (autoload 'w3m-retrieve "w3m")
   (autoload 'url-retrieve-synchronously "url"))
@@ -315,6 +320,7 @@ Increase this value when unexpected error frequently occurs."
         (url-request-data post-data)
         (url-request-extra-headers extra-headers)
         (url (mixi-expand-url url))
+        url-show-status
         (buffer (url-retrieve-synchronously url))
         ret)
     (unless (bufferp buffer)
@@ -398,7 +404,7 @@ Increase this value when unexpected error frequently occurs."
     (mixi-curl-retrieve url nil (reverse form-data))))
 
 (defconst mixi-my-id-regexp
-  "<a href=\"add_diary\\.pl\\?id=\\([0-9]+\\)")
+  "<a href=\"show_profile\\.pl\\?id=\\([0-9]+\\)")
 
 (defun mixi-login (&optional email password)
   "Login to mixi."
@@ -409,9 +415,9 @@ Increase this value when unexpected error frequently occurs."
                   (read-from-minibuffer (mixi-message "Login Email: "))))
        (password (or password mixi-default-password
                      (read-passwd (mixi-message "Login Password: ")))))
-    (let ((url "/login.pl"))
-      (when mixi-login-use-ssl
-       (setq url (concat "https://mixi.jp" url)))
+    (let ((url (mixi-expand-url "/login.pl")))
+      (when (and mixi-login-use-ssl (string-match "^http:" url))
+       (setq url (replace-match "https:" nil nil url)))
       (let ((buffer (mixi-retrieve url
                                   (concat "email=" email
                                           "&password=" password
@@ -507,24 +513,31 @@ Increase this value when unexpected error frequently occurs."
     (buffer-string)))
 
 ;; stolen (and modified) from w3m.el
-;; FIXME: Hmm.
-(defun mixi-url-encode-and-quote-percent-string (string)
+(defun mixi-url-encode-string (string)
   (apply (function concat)
         (mapcar
          (lambda (char)
            (cond
             ((eq char ?\n)             ; newline
-             "%%0D%%0A")
+             "%0D%0A")
             ((string-match "[-a-zA-Z0-9_:/.]" (char-to-string char)) ; xxx?
              (char-to-string char))    ; printable
             ((char-equal char ?\x20)   ; space
              "+")
             (t
-             (format "%%%%%02x" char))))       ; escape
+             (format "%%%02x" char)))) ; escape
          ;; Coerce a string into a list of chars.
          (append (encode-coding-string (or string "") mixi-coding-system)
                  nil))))
 
+(defun mixi-url-encode-and-quote-percent-string (string)
+  (let ((string (mixi-url-encode-string string))
+       (pos 0))
+    (while (string-match "%" string pos)
+      (setq string (replace-match "%%" nil nil string))
+      (setq pos (+ (match-end 0) 1)))
+    string))
+
 ;; Object.
 (defconst mixi-object-prefix "mixi-")
 
@@ -685,24 +698,24 @@ Increase this value when unexpected error frequently occurs."
     (unless (file-directory-p cache-directory)
       (make-directory cache-directory t))
     (let ((caches (apropos-internal mixi-cache-regexp 'boundp)))
-      (mapc (lambda (symbol)
-             (with-temp-file (expand-file-name
-                              (substring (symbol-name symbol)
-                                         (length mixi-object-prefix))
-                              cache-directory)
-               (let ((coding-system-for-write mixi-coding-system)
-                     (cache (symbol-value symbol)))
-                 (insert "#s(hash-table size "
-                         (number-to-string (hash-table-count cache))
-                         " test equal data (\n")
-                 (maphash
-                  (lambda (key value)
-                    (let (print-level print-length)
-                      (insert (prin1-to-string key) " "
-                              (prin1-to-string value) "\n")))
-                  cache))
-               (insert "))")))
-           caches))))
+      (while caches
+       (with-temp-file (expand-file-name
+                        (substring (symbol-name (car caches))
+                                   (length mixi-object-prefix))
+                        cache-directory)
+         (let ((coding-system-for-write mixi-coding-system)
+               (cache (symbol-value (car caches))))
+           (insert "#s(hash-table size "
+                   (number-to-string (hash-table-count cache))
+                   " test equal data (\n")
+           (maphash
+            (lambda (key value)
+              (let (print-level print-length)
+                (insert (prin1-to-string key) " "
+                        (prin1-to-string value) "\n")))
+            cache))
+         (insert "))"))
+       (setq caches (cdr caches))))))
 
 ;; stolen (and modified) from lsdb.el
 (defun mixi-read-cache (&optional marker)
@@ -738,17 +751,17 @@ Increase this value when unexpected error frequently occurs."
       ;; FIXME: Load friend and community first.
       (let ((files (directory-files cache-directory t
                                    mixi-cache-file-regexp)))
-       (mapc (lambda (file)
-               (let ((buffer (find-file-noselect file)))
-                 (unwind-protect
-                     (save-excursion
-                       (set-buffer buffer)
-                       (goto-char (point-min))
-                       (re-search-forward "^#s(")
-                       (goto-char (match-beginning 0))
-                       (mixi-read-cache (point-marker)))
-                   (kill-buffer buffer))))
-             files)))))
+       (while files
+         (let ((buffer (find-file-noselect (car files))))
+           (unwind-protect
+               (save-excursion
+                 (set-buffer buffer)
+                 (goto-char (point-min))
+                 (re-search-forward "^#s(")
+                 (goto-char (match-beginning 0))
+                 (mixi-read-cache (point-marker)))
+             (kill-buffer buffer)))
+         (setq files (cdr files)))))))
 
 ;; Friend object.
 (defvar mixi-friend-cache (make-hash-table :test 'equal))
@@ -766,7 +779,7 @@ Increase this value when unexpected error frequently occurs."
   "Return a my object."
   (unless mixi-me
     (with-mixi-retrieve "/home.pl"
-      (if (re-search-forward mixi-my-id-regexp)
+      (if (re-search-forward mixi-my-id-regexp nil t)
          (setq mixi-me (mixi-make-friend (match-string 1)))
        (signal 'error (list 'who-am-i)))))
   mixi-me)
@@ -941,7 +954,7 @@ Increase this value when unexpected error frequently occurs."
   (aref (cdr friend) 12))
 
 (defun mixi-friend-profile (friend)
-  "Return the pforile of FRIEND."
+  "Return the profile of FRIEND."
   (unless (mixi-friend-p friend)
     (signal 'wrong-type-argument (list 'mixi-friend-p friend)))
   (mixi-realize-friend friend)
@@ -1024,10 +1037,11 @@ Increase this value when unexpected error frequently occurs."
           (when ,friend (concat "&id=" (mixi-friend-id ,friend)))))
 
 (defconst mixi-friend-list-id-regexp
-  "<a href=show_friend\\.pl\\?id=\\([0-9]+\\)")
+  "<a href=\"?show_friend\\.pl\\?id=\\([0-9]+\\)\"?")
 (defconst mixi-friend-list-nick-regexp
-  "<td valign=middle>\\(.+\\)¤µ¤ó([0-9]+)<br />")
+  "<td valign=\"?top\"?>\\(.+\\)¤µ¤ó([0-9]+)")
 
+;;;###autoload
 (defun mixi-get-friends (&rest friend-or-range)
   "Get friends of FRIEND."
   (when (> (length friend-or-range) 2)
@@ -1058,27 +1072,19 @@ Increase this value when unexpected error frequently occurs."
 (defmacro mixi-favorite-list-page ()
   `(concat "/list_bookmark.pl?page=%d"))
 
-(defconst mixi-favorite-list-id-regexp
-  "<td ALIGN=center BGCOLOR=#FDF9F2 width=330><a href=\"show_friend\\.pl\\?id=\\([0-9]+\\)\">")
-(defconst mixi-favorite-list-nick-regexp
-  "<td BGCOLOR=#FDF9F2><font COLOR=#996600>̾&nbsp;&nbsp;Á°</font></td>
-<td COLSPAN=2 BGCOLOR=#FFFFFF>\\(.+\\)</td></tr>")
+(defconst mixi-favorite-list-regexp
+  "<td bgcolor=\"#FDF9F2\"><font color=\"#996600\">̾Á°</font></td>
+<td colspan=\"2\" bgcolor=\"#FFFFFF\"><a href=\"show_friend\\.pl\\?id=\\([0-9]+\\)\">\\(.*\\)</a></td>")
 
+;;;###autoload
 (defun mixi-get-favorites (&optional range)
   "Get favorites."
-  (let ((ids (mixi-get-matched-items (mixi-favorite-list-page)
-                                    mixi-favorite-list-id-regexp
-                                    range))
-       (nicks (mixi-get-matched-items (mixi-favorite-list-page)
-                                      mixi-favorite-list-nick-regexp
+  (let ((items (mixi-get-matched-items (mixi-favorite-list-page)
+                                      mixi-favorite-list-regexp
                                       range)))
-    (let ((index 0)
-         ret)
-      (while (< index (length ids))
-       (setq ret (cons (mixi-make-friend (nth 0 (nth index ids))
-                                         (nth 0 (nth index nicks))) ret))
-       (incf index))
-      (reverse ret))))
+    (mapcar (lambda (item)
+             (mixi-make-friend (nth 0 item) (nth 1 item)))
+           items)))
 
 ;; Log object.
 (defun mixi-make-log (friend time)
@@ -1104,8 +1110,9 @@ Increase this value when unexpected error frequently occurs."
   `(concat "/show_log.pl"))
 
 (defconst mixi-log-list-regexp
-  "\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\) <a href=\"show_friend\\.pl\\?id=\\([0-9]+\\)\">\\(.*\\)</a></li>")
+  "\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\) <a href=\"show_friend\\.pl\\?id=\\([0-9]+\\)\">\\(.*?\\)</a>")
 
+;;;###autoload
 (defun mixi-get-logs (&optional range)
   "Get logs."
   (let ((items (mixi-get-matched-items (mixi-log-list-page)
@@ -1150,39 +1157,41 @@ Increase this value when unexpected error frequently occurs."
           "&owner_id=" (mixi-friend-id (mixi-diary-owner ,diary))))
 
 (defconst mixi-diary-closed-regexp
-  "<td>ͧ¿Í\\(¤Îͧ¿Í\\)?¤Þ¤Ç¸ø³«¤Î¤¿¤áÆɤळ¤È¤¬½ÐÍè¤Þ¤»¤ó¡£</td></tr>")
+  "<td>ͧ¿Í\\(¤Îͧ¿Í\\)?¤Þ¤Ç¸ø³«¤Î¤¿¤áÆɤळ¤È¤¬½ÐÍè¤Þ¤»¤ó¡£</td>")
 (defconst mixi-diary-owner-nick-regexp
-  "<td WIDTH=490 background=http://img\\.mixi\\.jp/img/bg_w\\.gif><b><font COLOR=#605048>\\(.+?\\)\\(¤µ¤ó\\)?¤ÎÆüµ­</font></b></td>")
+  "<td width=\"?490\"? background=\"?http://img\\.mixi\\.jp/img/bg_w\\.gif\"?><b><font color=\"?#605048\"?>\\(.+?\\)\\(¤µ¤ó\\)?¤ÎÆüµ­</font></b></td>")
 (defconst mixi-diary-time-regexp
-  "<td \\(align\\|ALIGN\\)=\"?center\"? \\(rowspan\\|ROWSPAN\\)=\"?[23]\"? \\(nowrap=\"nowrap\"\\|NOWRAP\\) \\(width\\|WIDTH\\)=\"?95\"? bgcolor=\"?#FFD8B0\"?>\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü\\(<br />\\|<br>\\)\\([0-9]+\\):\\([0-9]+\\)</td>")
+  "<td align=\"?center\"? rowspan=\"?[23]\"? nowrap\\(=\"?nowrap\"?\\)? width=\"?95\"? bgcolor=\"?#FFD8B0\"?>\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü<br\\( /\\)?>\\([0-9]+\\):\\([0-9]+\\)</td>")
 (defconst mixi-diary-title-regexp
-  "<td \\(bgcolor\\|BGCOLOR\\)=\"?#FFF4E0\"? width=\"?430\"?>&nbsp;\\([^<]+\\)</td>")
+  "<td bgcolor=\"?#FFF4E0\"? width=\"?430\"?>&nbsp;\\([^<]+\\)</td>")
 (defconst mixi-diary-content-regexp
-  "<td \\(class\\|CLASS\\)=\"?h12\"?>\\(.*\\)</td>")
+  "<td class=\"?h12\"? width=\"?410\"?>\\(\\(.\\|\r?\n\\)*?\\)</td>")
 
 (defun mixi-realize-diary (diary &optional page)
   "Realize a DIARY."
   ;; FIXME: Check a expiration of cache?
   (unless (mixi-object-realized-p diary)
     (with-mixi-retrieve (or page (mixi-diary-page diary))
-      (unless (re-search-forward mixi-diary-closed-regexp nil t)
-       (if (re-search-forward mixi-diary-owner-nick-regexp nil t)
-           (mixi-friend-set-nick (mixi-diary-owner diary) (match-string 1))
-         (mixi-realization-error 'cannot-find-owner-nick diary))
-       (if (re-search-forward mixi-diary-time-regexp nil t)
-           (mixi-diary-set-time
-            diary (encode-time 0 (string-to-number (match-string 10))
-                               (string-to-number (match-string 9))
-                               (string-to-number (match-string 7))
-                               (string-to-number (match-string 6))
-                               (string-to-number (match-string 5))))
-         (mixi-realization-error 'cannot-find-time diary))
-       (if (re-search-forward mixi-diary-title-regexp nil t)
-           (mixi-diary-set-title diary (match-string 2))
-         (mixi-realization-error 'cannot-find-title diary))
-       (if (re-search-forward mixi-diary-content-regexp nil t)
-           (mixi-diary-set-content diary (match-string 2))
-         (mixi-realization-error 'cannot-find-content diary))))
+      (let ((case-fold-search t))
+       (unless (re-search-forward mixi-diary-closed-regexp nil t)
+         (if (re-search-forward mixi-diary-owner-nick-regexp nil t)
+             (mixi-friend-set-nick (mixi-diary-owner diary)
+                                   (match-string 1))
+           (mixi-realization-error 'cannot-find-owner-nick diary))
+         (if (re-search-forward mixi-diary-time-regexp nil t)
+             (mixi-diary-set-time
+              diary (encode-time 0 (string-to-number (match-string 7))
+                                 (string-to-number (match-string 6))
+                                 (string-to-number (match-string 4))
+                                 (string-to-number (match-string 3))
+                                 (string-to-number (match-string 2))))
+           (mixi-realization-error 'cannot-find-time diary))
+         (if (re-search-forward mixi-diary-title-regexp nil t)
+             (mixi-diary-set-title diary (match-string 1))
+           (mixi-realization-error 'cannot-find-title diary))
+         (if (re-search-forward mixi-diary-content-regexp nil t)
+             (mixi-diary-set-content diary (match-string 1))
+           (mixi-realization-error 'cannot-find-content diary)))))
     (mixi-object-touch diary)))
 
 (defun mixi-diary-owner (diary)
@@ -1259,6 +1268,7 @@ Increase this value when unexpected error frequently occurs."
 <td ALIGN=center ROWSPAN=3 NOWRAP bgcolor=#F2DDB7><font COLOR=#996600>\\([0-9]+\\)·î\\([0-9]+\\)Æü<br>\\([0-9]+\\):\\([0-9]+\\)</font>\\(<br><input type=\"checkbox\" name=\"diary_id\" value=\"[0-9]+\">\\|\\)</td>
 <td bgcolor=\"#FFF4E0\">&nbsp;<a href=\"view_diary\\.pl\\?id=\\([0-9]+\\)&owner_id=[0-9]+\">\\(.*\\)</a></td>")
 
+;;;###autoload
 (defun mixi-get-diaries (&rest friend-or-range)
   "Get diaries of FRIEND."
   (when (> (length friend-or-range) 2)
@@ -1297,6 +1307,7 @@ Increase this value when unexpected error frequently occurs."
   "<td WIDTH=180><img src=http://img\\.mixi\\.jp/img/pen\\.gif ALIGN=left WIDTH=14 HEIGHT=16>\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\)</td>
 <td WIDTH=450><a class=\"new_link\" href=view_diary\\.pl\\?id=\\([0-9]+\\)&owner_id=\\([0-9]+\\)>\\(.+\\)</a> (\\(.*\\)) ")
 
+;;;###autoload
 (defun mixi-get-new-diaries (&optional range)
   "Get new diaries."
   (let ((items (mixi-get-matched-items (mixi-new-diary-list-page)
@@ -1331,7 +1342,7 @@ Increase this value when unexpected error frequently occurs."
 
 <tr>
 <td BGCOLOR=#FDF9F2><font COLOR=#996600>ËÜ&nbsp;&nbsp;ʸ</font></td>
-<td COLSPAN=2 BGCOLOR=#FFFFFF>\\(.*\\)</td></tr>
+<td COLSPAN=2 BGCOLOR=#FFFFFF width=\"380\">\\(.*\\)</td></tr>
 
 
 <tr>
@@ -1341,6 +1352,7 @@ Increase this value when unexpected error frequently occurs."
 </table>
 </td></tr></table>")
 
+;;;###autoload
 (defun mixi-search-diaries (keyword &optional range)
   (let ((items (mixi-get-matched-items (mixi-search-diary-list-page keyword)
                                       mixi-search-diary-list-regexp
@@ -1373,6 +1385,7 @@ Increase this value when unexpected error frequently occurs."
   "<b>\\(ºîÀ®\\|½ñ¤­¹þ¤ß\\)¤¬´°Î»¤·¤Þ¤·¤¿¡£È¿±Ç¤Ë»þ´Ö¤¬¤«¤«¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢É½¼¨¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¾¯¡¹¤ªÂÔ¤Á¤¯¤À¤µ¤¤¡£</b>")
 
 ;; FIXME: Support photos.
+;;;###autoload
 (defun mixi-post-diary (title content)
   "Post a diary."
   (unless (stringp title)
@@ -1427,71 +1440,83 @@ Increase this value when unexpected error frequently occurs."
 (defconst mixi-community-nodata-regexp
   "^¥Ç¡¼¥¿¤¬¤¢¤ê¤Þ¤»¤ó")
 (defconst mixi-community-name-regexp
-  "<td WIDTH=345>\\(.*\\)</td></tr>")
+  "<td width=\"?345\"?>\\(.*\\)</td></tr>")
 (defconst mixi-community-birthday-regexp
-  "<td BGCOLOR=#F2DDB7 WIDTH=80><font COLOR=#996600>³«ÀßÆü</font></td>\r
-<td WIDTH=345>\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü")
+  "<td bgcolor=\"?#F2DDB7\"? width=\"?80\"?><font color=\"?#996600\"?>³«ÀßÆü</font></td>
+<td width=\"?345\"?>\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü")
 ;; FIXME: Care when the owner has seceded.
 (defconst mixi-community-owner-regexp
-  "<td BGCOLOR=#F2DDB7 WIDTH=80><font COLOR=#996600>´ÉÍý¿Í</font></td>\r
-<td WIDTH=345>\r
-<table style=\"width: 100%;\"><tr><td>\r
+  "<td bgcolor=\"?#F2DDB7\"? width=\"?80\"?><font color=\"?#996600\"?>´ÉÍý¿Í</font></td>
+<td width=\"?345\"?>
+<table style=\"width: 100%;\"><tr><td>
 <a href=\"\\(home\\.pl\\|show_friend\\.pl\\?id=\\([0-9]+\\)\\)\">\\(.*\\)</a>")
 (defconst mixi-community-category-regexp
-  "<td BGCOLOR=#F2DDB7 WIDTH=80><font COLOR=#996600>¥«¥Æ¥´¥ê</font></td>\r
-<td WIDTH=345>\\([^<]+\\)</td>")
+  "<td bgcolor=\"?#F2DDB7\"? width=\"?80\"?><font color=\"?#996600\"?>¥«¥Æ¥´¥ê</font></td>
+<td width=\"?345\"?>
+\\(.+\\)
+</td>")
 (defconst mixi-community-members-regexp
-  "<td BGCOLOR=#F2DDB7 WIDTH=80><font COLOR=#996600>¥á¥ó¥Ð¡¼¿ô</font></td>\r
-<td WIDTH=345>\\([0-9]+\\)¿Í</td></tr>")
+  "<td bgcolor=\"?#F2DDB7\"? width=\"?80\"?><font color=\"?#996600\"?>¥á¥ó¥Ð¡¼¿ô</font></td>
+<td width=\"?345\"?>
+\\([0-9]+\\)¿Í
+</td>")
 (defconst mixi-community-open-level-regexp
-  "<td BGCOLOR=#F2DDB7 WIDTH=80><font COLOR=#996600>»²²Ã¾ò·ï¤È<br>¸ø³«¥ì¥Ù¥ë</font></td>\r
-<td WIDTH=345>\\(.+\\)</td></tr>")
+  "<td bgcolor=\"?#F2DDB7\"? width=\"?80\"?><font color=\"?#996600\"?>»²²Ã¾ò·ï¤È<br />¸ø³«¥ì¥Ù¥ë</font></td>
+<td width=\"?345\"?>
+\\(.+\\)
+</td>")
 (defconst mixi-community-authority-regexp
-  "<td BGCOLOR=#F2DDB7 WIDTH=80><font COLOR=#996600>¥È¥Ô¥Ã¥¯ºîÀ®¤Î¸¢¸Â</font></td>\r
-<td WIDTH=345>\\(.+\\)</td></tr>")
+  "<td bgcolor=\"?#F2DDB7\"? width=\"?80\"?><font color=\"?#996600\"?>¥È¥Ô¥Ã¥¯ºîÀ®¤Î¸¢¸Â</font></td>
+<td width=\"?345\"?>
+\\(.+\\)
+
+
+</td>")
 (defconst mixi-community-description-regexp
-  "<td CLASS=h120 WIDTH=345>\\(.+\\)</td>")
+  "<td class=\"?h120\"? width=\"?345\"?>\\(.+\\)</td>")
 
 (defun mixi-realize-community (community)
   "Realize a COMMUNITY."
   ;; FIXME: Check a expiration of cache?
   (unless (mixi-object-realized-p community)
     (with-mixi-retrieve (mixi-community-page community)
-      (if (re-search-forward mixi-community-nodata-regexp nil t)
-         ;; FIXME: Set all members?
-         (mixi-community-set-name community "¥Ç¡¼¥¿¤¬¤¢¤ê¤Þ¤»¤ó")
-       (if (re-search-forward mixi-community-name-regexp nil t)
-           (mixi-community-set-name community (match-string 1))
-         (mixi-realization-error 'cannot-find-name community))
-       (if (re-search-forward mixi-community-birthday-regexp nil t)
-           (mixi-community-set-birthday
-            community (encode-time 0 0 0 (string-to-number (match-string 3))
-                                   (string-to-number (match-string 2))
-                                   (string-to-number (match-string 1))))
-         (mixi-realization-error 'cannot-find-birthday community))
-       (if (re-search-forward mixi-community-owner-regexp nil t)
-           (if (string= (match-string 1) "home.pl")
-               (mixi-community-set-owner community (mixi-make-me))
-             (mixi-community-set-owner community
-                                       (mixi-make-friend (match-string 2)
-                                                         (match-string 3))))
-         (mixi-realization-error 'cannot-find-owner community))
-       (if (re-search-forward mixi-community-category-regexp nil t)
-           (mixi-community-set-category community (match-string 1))
-         (mixi-realization-error 'cannot-find-category community))
-       (if (re-search-forward mixi-community-members-regexp nil t)
-           (mixi-community-set-members community
-                                       (string-to-number (match-string 1)))
-         (mixi-realization-error 'cannot-find-members community))
-       (if (re-search-forward mixi-community-open-level-regexp nil t)
-           (mixi-community-set-open-level community (match-string 1))
-         (mixi-realization-error 'cannot-find-open-level community))
-       (if (re-search-forward mixi-community-authority-regexp nil t)
-           (mixi-community-set-authority community (match-string 1))
-         (mixi-realization-error 'cannot-find-authority community))
-       (if (re-search-forward mixi-community-description-regexp nil t)
-           (mixi-community-set-description community (match-string 1))
-         (mixi-realization-error 'cannot-find-description community))))
+      (let ((case-fold-search t))
+       (if (re-search-forward mixi-community-nodata-regexp nil t)
+           ;; FIXME: Set all members?
+           (mixi-community-set-name community "¥Ç¡¼¥¿¤¬¤¢¤ê¤Þ¤»¤ó")
+         (if (re-search-forward mixi-community-name-regexp nil t)
+             (mixi-community-set-name community (match-string 1))
+           (mixi-realization-error 'cannot-find-name community))
+         (if (re-search-forward mixi-community-birthday-regexp nil t)
+             (mixi-community-set-birthday
+              community (encode-time 0 0 0
+                                     (string-to-number (match-string 3))
+                                     (string-to-number (match-string 2))
+                                     (string-to-number (match-string 1))))
+           (mixi-realization-error 'cannot-find-birthday community))
+         (if (re-search-forward mixi-community-owner-regexp nil t)
+             (if (string= (match-string 1) "home.pl")
+                 (mixi-community-set-owner community (mixi-make-me))
+               (mixi-community-set-owner community (mixi-make-friend
+                                                    (match-string 2)
+                                                    (match-string 3))))
+           (mixi-realization-error 'cannot-find-owner community))
+         (if (re-search-forward mixi-community-category-regexp nil t)
+             (mixi-community-set-category community (match-string 1))
+           (mixi-realization-error 'cannot-find-category community))
+         (if (re-search-forward mixi-community-members-regexp nil t)
+             (mixi-community-set-members community
+                                         (string-to-number (match-string 1)))
+           (mixi-realization-error 'cannot-find-members community))
+         (if (re-search-forward mixi-community-open-level-regexp nil t)
+             (mixi-community-set-open-level community (match-string 1))
+           (mixi-realization-error 'cannot-find-open-level community))
+         (if (re-search-forward mixi-community-authority-regexp nil t)
+             (mixi-community-set-authority community (match-string 1))
+           (mixi-realization-error 'cannot-find-authority community))
+         (if (re-search-forward mixi-community-description-regexp nil t)
+             (mixi-community-set-description community (match-string 1))
+           (mixi-realization-error 'cannot-find-description community)))))
     (mixi-object-touch community)))
 
 (defun mixi-community-id (community)
@@ -1612,10 +1637,11 @@ Increase this value when unexpected error frequently occurs."
           (when ,friend (concat "&id=" (mixi-friend-id ,friend)))))
 
 (defconst mixi-community-list-id-regexp
-  "<a href=view_community\\.pl\\?id=\\([0-9]+\\)")
+  "<a href=\"?view_community\\.pl\\?id=\\([0-9]+\\)\"?")
 (defconst mixi-community-list-name-regexp
-  "<td valign=middle>\\(.+\\)([0-9]+)</td>")
+  "<td valign=\"?top\"?>\\(.+\\)([0-9]+)")
 
+;;;###autoload
 (defun mixi-get-communities (&rest friend-or-range)
   "Get communities of FRIEND."
   (when (> (length friend-or-range) 2)
@@ -1653,6 +1679,7 @@ Increase this value when unexpected error frequently occurs."
 <td COLSPAN=2 WIDTH=370 BGCOLOR=#FFFFFF>\\([^<]+\\)</td></tr>")
 
 ;; FIXME: Support category.
+;;;###autoload
 (defun mixi-search-communities (keyword &optional range)
   (let ((items (mixi-get-matched-items (mixi-search-community-list-page
                                        keyword)
@@ -1699,7 +1726,7 @@ Increase this value when unexpected error frequently occurs."
 (defconst mixi-topic-owner-regexp
   "<td bgcolor=\"#fdf9f2\">&nbsp;<font color=\"#dfb479\"></font>&nbsp;<a href=\"show_friend\\.pl\\?id=\\([0-9]+\\)\">\\(.*?\\)\\(¤µ¤ó\\)?</a>")
 (defconst mixi-topic-content-regexp
-  "<table width=\"500\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\"><tr><td class=\"h120\"><table><tr>\\(<td width=\"130\" height=\"140\" align=\"center\" valign=\"middle\"><a href=\"javascript:void(0)\" onClick=\"MM_openBrWindow('show_bbs_picture\\.pl\\?id=[0-9]+&comm_id=[0-9]+&number=[0-9]+','pict','width=680,height=660,toolbar=no,scrollbars=yes,left=5,top=5')\"><img src=\"http://ic[0-9]+\\.mixi\\.jp/[^.]+\\.jpg\" border=\"0\"></a></td>\n\\)*</tr></table>\\(.+\\)</td></tr></table>")
+  "<table width=\"500\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\"><tr><td class=\"h120\" width=\"500\"><table><tr>\\(<td width=\"130\" height=\"140\" align=\"center\" valign=\"middle\"><a href=\"javascript:void(0)\" onClick=\"MM_openBrWindow('show_bbs_picture\\.pl\\?id=[0-9]+&comm_id=[0-9]+&number=[0-9]+','pict','width=680,height=660,toolbar=no,scrollbars=yes,left=5,top=5')\"><img src=\"http://ic[0-9]+\\.mixi\\.jp/[^.]+\\.jpg\" border=\"0\"></a></td>\n\\)*</tr></table>\\(.+\\)</td></tr></table>")
 
 (defun mixi-realize-topic (topic &optional page)
   "Realize a TOPIC."
@@ -1812,6 +1839,7 @@ Increase this value when unexpected error frequently occurs."
   `(concat "/add_bbs.pl?id=" (mixi-community-id community)))
 
 ;; FIXME: Support photos.
+;;;###autoload
 (defun mixi-post-topic (community title content)
   "Post a topic to COMMUNITY."
   (unless (mixi-community-p community)
@@ -1866,39 +1894,39 @@ Increase this value when unexpected error frequently occurs."
           "&comm_id=" (mixi-community-id (mixi-event-community ,event))))
 
 (defconst mixi-event-community-regexp
-  "<td WIDTH=595 background=http://img\\.mixi\\.jp/img/bg_w\\.gif><b>\\[\\(.+\\)\\] ¥¤¥Ù¥ó¥È</b></td>")
+  "<td width=\"?595\"? background=\"?http://img\\.mixi\\.jp/img/bg_w\\.gif\"?><b>\\[\\(.+\\)\\] ¥¤¥Ù¥ó¥È</b></td>")
 (defconst mixi-event-time-regexp
-  "<td ROWSPAN=11 \\(BGCOLOR\\|bgcolor\\)=#FFD8B0 \\(ALIGN\\|align\\)=center \\(VALIGN\\|Valign\\)=top WIDTH=110>
+  "<td rowspan=\"?11\"? bgcolor=\"?#FFD8B0\"? align=\"?center\"? valign=\"?top\"? width=\"?110\"?>
 ?\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü<br>
 ?\\([0-9]+\\):\\([0-9]+\\)</td>")
 (defconst mixi-event-title-regexp
-  "<td bgcolor=#FFF4E0\\( width=410\\)?>&nbsp;\\([^<]+\\)</td>")
+  "<td bgcolor=\"?#FFF4E0\"?\\( width=\"?410\"?\\)?>&nbsp;\\([^<]+\\)</td>")
 (defconst mixi-event-owner-regexp
-  "<td \\(BGCOLOR\\|bgcolor\\)=#FDF9F2>&nbsp;<a href=\"show_friend\\.pl\\?id=\\([0-9]+\\)\">\\(.*\\)</a>")
+  "<td bgcolor=\"?#FDF9F2\"?>&nbsp;<a href=\"show_friend\\.pl\\?id=\\([0-9]+\\)\">\\(.*\\)</a>")
 (defconst mixi-event-owner-seceded-regexp
-  "<td \\(BGCOLOR\\|bgcolor\\)=#FDF9F2>&nbsp;\\((mixi Âà²ñºÑ)\\)")
+  "<td bgcolor=\"?#FDF9F2\"?>&nbsp;\\((mixi Âà²ñºÑ)\\)")
 (defconst mixi-event-date-regexp
-  "<td \\(BGCOLOR\\|bgcolor\\)=#\\(FFFFFF\\|ffffff\\) \\(ALIGN\\|align\\)=center NOWRAP>³«ºÅÆü»þ</td>
-<td \\(BGCOLOR\\|bgcolor\\)=#\\(FFFFFF\\|ffffff\\)>
+  "<td bgcolor=\"?#FFFFFF\"? align=\"?center\"? nowrap>³«ºÅÆü»þ</td>
+<td bgcolor=\"?#FFFFFF\"?>
 &nbsp;\\(.+\\)
 </td>")
 (defconst mixi-event-place-regexp
-  "<td \\(BGCOLOR\\|bgcolor\\)=#\\(FFFFFF\\|ffffff\\) \\(ALIGN\\|align\\)=center NOWRAP>³«ºÅ¾ì½ê</td>
-<td \\(BGCOLOR\\|bgcolor\\)=#\\(FFFFFF\\|ffffff\\)>
+  "<td bgcolor=\"?#FFFFFF\"? align=\"?center\"? nowrap>³«ºÅ¾ì½ê</td>
+<td bgcolor=\"?#FFFFFF\"?>
 &nbsp;\\(.+\\)
 </td>")
 (defconst mixi-event-detail-regexp
-  "<td \\(BGCOLOR\\|bgcolor\\)=#\\(FFFFFF\\|ffffff\\) \\(ALIGN\\|align\\)=center NOWRAP>¾ÜºÙ</td>
-<td \\(BGCOLOR\\|bgcolor\\)=#\\(FFFFFF\\|ffffff\\)><table BORDER=0 CELLSPACING=0 CELLPADDING=5><tr><td CLASS=h120>\\(.+\\)</td></tr></table></td>")
+  "<td bgcolor=\"?#FFFFFF\"? align=\"?center\"? nowrap>¾ÜºÙ</td>
+<td bgcolor=\"?#FFFFFF\"?><table border=\"?0\"? cellspacing=\"?0\"? cellpadding=\"?5\"?><tr><td class=\"?h120\"? width=\"?410\"?>\\(.+\\)</td></tr></table></td>")
 (defconst mixi-event-limit-regexp
-  "<td \\(BGCOLOR\\|bgcolor\\)=\"?#\\(FFFFFF\\|ffffff\\)\"? \\(ALIGN\\|align\\)=\"?center\"? NOWRAP>Ê罸´ü¸Â</td>
-?<td \\(BGCOLOR\\|bgcolor\\)=#\\(FFFFFF\\|ffffff\\)>&nbsp;\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü</td>")
+  "<td bgcolor=\"?#FFFFFF\"? align=\"?center\"? nowrap>Ê罸´ü¸Â</td>
+?<td bgcolor=\"?#FFFFFF\"?>&nbsp;\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü</td>")
 (defconst mixi-event-members-regexp
-  "<td \\(BGCOLOR\\|bgcolor\\)=#\\(FFFFFF\\|ffffff\\) \\(ALIGN\\|align\\)=center NOWRAP>»²²Ã¼Ô</td>
-<td \\(BGCOLOR\\|bgcolor\\)=#\\(FFFFFF\\|ffffff\\)>
+  "<td bgcolor=\"?#FFFFFF\"? align=\"?center\"? nowrap>»²²Ã¼Ô</td>
+<td bgcolor=\"?#FFFFFF\"?>
 
 ?
-?<table BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%>
+?<table border=\"?0\"? cellspacing=\"?0\"? cellpadding=\"?0\"? width=\"?100%\"?>
 <tr>
 
 ?<td>&nbsp;\\(.+\\)</td>")
@@ -1908,45 +1936,46 @@ Increase this value when unexpected error frequently occurs."
   ;; FIXME: Check a expiration of cache?
   (unless (mixi-object-realized-p event)
     (with-mixi-retrieve (or page (mixi-event-page event))
-      (if (re-search-forward mixi-event-community-regexp nil t)
-         (mixi-community-set-name (mixi-event-community event)
-                                  (match-string 1))
-       (mixi-realization-error 'cannot-find-community event))
-      (if (re-search-forward mixi-event-time-regexp nil t)
-         (mixi-event-set-time
-          event (encode-time 0 (string-to-number (match-string 8))
-                             (string-to-number (match-string 7))
-                             (string-to-number (match-string 6))
-                             (string-to-number (match-string 5))
-                             (string-to-number (match-string 4))))
-       (mixi-realization-error 'cannot-find-time event))
-      (if (re-search-forward mixi-event-title-regexp nil t)
-         (mixi-event-set-title event (match-string 2))
-       (mixi-realization-error 'cannot-find-title event))
-      (if (re-search-forward mixi-event-owner-regexp nil t)
-         (mixi-event-set-owner event (mixi-make-friend (match-string 2)
-                                                       (match-string 3)))
-       (if (re-search-forward mixi-event-owner-seceded-regexp nil t)
-           (mixi-event-set-owner event
-                                 (mixi-make-friend nil (match-string 2)))
-         (mixi-realization-error 'cannot-find-owner event)))
-      (if (re-search-forward mixi-event-date-regexp nil t)
-         (mixi-event-set-date event (match-string 6))
-       (mixi-realization-error 'cannot-find-date event))
-      (if (re-search-forward mixi-event-place-regexp nil t)
-         (mixi-event-set-place event (match-string 6))
-       (mixi-realization-error 'cannot-find-place event))
-      (if (re-search-forward mixi-event-detail-regexp nil t)
-         (mixi-event-set-detail event (match-string 6))
-       (mixi-realization-error 'cannot-find-detail event))
-      (when (re-search-forward mixi-event-limit-regexp nil t)
-       (mixi-event-set-limit
-        event (encode-time 0 0 0 (string-to-number (match-string 8))
-                           (string-to-number (match-string 7))
-                           (string-to-number (match-string 6)))))
-      (if (re-search-forward mixi-event-members-regexp nil t)
-         (mixi-event-set-members event (match-string 6))
-       (mixi-realization-error 'cannot-find-members event)))
+      (let ((case-fold-search t))
+       (if (re-search-forward mixi-event-community-regexp nil t)
+           (mixi-community-set-name (mixi-event-community event)
+                                    (match-string 1))
+         (mixi-realization-error 'cannot-find-community event))
+       (if (re-search-forward mixi-event-time-regexp nil t)
+           (mixi-event-set-time
+            event (encode-time 0 (string-to-number (match-string 5))
+                               (string-to-number (match-string 4))
+                               (string-to-number (match-string 3))
+                               (string-to-number (match-string 2))
+                               (string-to-number (match-string 1))))
+         (mixi-realization-error 'cannot-find-time event))
+       (if (re-search-forward mixi-event-title-regexp nil t)
+           (mixi-event-set-title event (match-string 2))
+         (mixi-realization-error 'cannot-find-title 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)))
+       (if (re-search-forward mixi-event-date-regexp nil t)
+           (mixi-event-set-date event (match-string 1))
+         (mixi-realization-error 'cannot-find-date event))
+       (if (re-search-forward mixi-event-place-regexp nil t)
+           (mixi-event-set-place event (match-string 1))
+         (mixi-realization-error 'cannot-find-place 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))
+       (when (re-search-forward mixi-event-limit-regexp nil t)
+         (mixi-event-set-limit
+          event (encode-time 0 0 0 (string-to-number (match-string 3))
+                             (string-to-number (match-string 2))
+                             (string-to-number (match-string 1)))))
+       (if (re-search-forward mixi-event-members-regexp nil t)
+           (mixi-event-set-members event (match-string 1))
+         (mixi-realization-error 'cannot-find-members event))))
     (mixi-object-touch event)))
 
 (defun mixi-event-community (event)
@@ -2122,6 +2151,7 @@ Increase this value when unexpected error frequently occurs."
 (defconst mixi-bbs-list-regexp
   "<a href=view_\\(bbs\\|event\\)\\.pl\\?id=\\([0-9]+\\)")
 
+;;;###autoload
 (defun mixi-get-bbses (community &optional range)
   "Get bbese of COMMUNITY."
   (unless (mixi-community-p community)
@@ -2143,6 +2173,7 @@ Increase this value when unexpected error frequently occurs."
 (defconst mixi-new-bbs-list-regexp
   "<a href=\"view_\\(bbs\\|event\\)\\.pl\\?id=\\([0-9]+\\)&comment_count=\\([0-9]+\\)&comm_id=\\([0-9]+\\)\" class=\"new_link\">")
 
+;;;###autoload
 (defun mixi-get-new-bbses (&optional range)
   "Get new topics."
   (let ((items (mixi-get-matched-items (mixi-new-bbs-list-page)
@@ -2174,6 +2205,7 @@ Increase this value when unexpected error frequently occurs."
   "<a href=\"view_\\(bbs\\|event\\)\\.pl\\?id=\\([0-9]+\\)&comm_id=\\([0-9]+\\)\"><img src=http://img\\.mixi\\.jp/img/shbtn\\.gif ALT=¾ÜºÙ¤ò¸«¤ë BORDER=0 WIDTH=104 HEIGHT=19></a>")
 
 ;; FIXME: Support community and category.
+;;;###autoload
 (defun mixi-search-bbses (keyword &optional range)
   (let ((items (mixi-get-matched-items (mixi-search-bbs-list-page keyword)
                                       mixi-search-bbs-list-regexp
@@ -2190,7 +2222,7 @@ Increase this value when unexpected error frequently occurs."
 ;; Parent object.
 (defmacro mixi-parent-p (object)
   `(or (eq (mixi-object-class ,object) 'mixi-diary)
-       (mixi-bbs-p object)))
+       (mixi-bbs-p ,object)))
 
 (defun mixi-realize-parent (parent &optional page)
   "Realize a PARENT."
@@ -2239,7 +2271,7 @@ Increase this value when unexpected error frequently occurs."
 
 ;; FIXME: Split regexp to time, owner(id and nick) and contents.
 (defconst mixi-diary-comment-list-regexp
-"<td rowspan=\"2\" align=\"center\" width=\"95\" bgcolor=\"#f2ddb7\" nowrap>
+  "<td rowspan=\"2\" align=\"center\" width=\"95\" bgcolor=\"#f2ddb7\" nowrap>
 \\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü<br>\\([0-9]+\\):\\([0-9]+\\)\\(<br>
 <input type=checkbox name=comment_id value=\".+\">
 \\|\\)
@@ -2262,7 +2294,7 @@ Increase this value when unexpected error frequently occurs."
 <td bgcolor=\"#ffffff\">
 <table BORDER=0 CELLSPACING=0 CELLPADDING=[35] WIDTH=410>
 <tr>
-<td CLASS=h12>
+<td CLASS=h12 width=\"410\">
 \\(.+\\)
 </td></tr></table>")
 
@@ -2293,7 +2325,7 @@ Increase this value when unexpected error frequently occurs."
 <td bgcolor=\"#ffffff\" align=\"center\">
 <table border=\"0\" cellspacing=\"0\" cellpadding=\"5\" width=\"500\">
 <tr>
-<td class=\"h120\">
+<td class=\"h120\" width=\"500\">
 
 \\(.+\\)
 </td>
@@ -2326,11 +2358,12 @@ Increase this value when unexpected error frequently occurs."
 <tr>
 <td ALIGN=center BGCOLOR=#FFFFFF>
 <table BORDER=0 CELLSPACING=0 CELLPADDING=5 WIDTH=500>
-<tr><td CLASS=h120>\\(.+\\)</td></tr>
+<tr><td CLASS=h120 width=\"500\">\\(.+\\)</td></tr>
 </table>
 </td>
 </tr>")
 
+;;;###autoload
 (defun mixi-get-comments (parent &optional range)
   "Get comments of PARENT."
   (unless (mixi-parent-p parent)
@@ -2364,23 +2397,24 @@ Increase this value when unexpected error frequently occurs."
 (defconst mixi-new-comment-list-regexp
   "<a href=\"view_diary\\.pl\\?id=\\([0-9]+\\)&owner_id=\\([0-9]+\\)&comment_count=\\([0-9]+\\)\" class=\"new_link\">")
 
+;;;###autoload
 (defun mixi-get-new-comments (&optional range)
   "Get new comments."
   (let ((items (mixi-get-matched-items (mixi-new-comment-list-page)
-                                       mixi-new-comment-list-regexp
-                                       range)))
+                                      mixi-new-comment-list-regexp
+                                      range)))
     (delq nil
-          (mapcar (lambda (item)
-                    (let* ((diary (mixi-make-diary
-                                   (mixi-make-friend (nth 1 item))
+         (mapcar (lambda (item)
+                   (let* ((diary (mixi-make-diary
+                                  (mixi-make-friend (nth 1 item))
                                   (nth 0 item)))
-                           (comment-count (mixi-diary-comment-count diary))
+                          (comment-count (mixi-diary-comment-count diary))
                           (count (string-to-number (nth 2 item))))
-                      (when (or (null comment-count)
-                                (< comment-count count))
+                     (when (or (null comment-count)
+                               (< comment-count count))
                        (mixi-diary-set-comment-count diary count)
-                        diary)))
-                  items))))
+                       diary)))
+                 items))))
 
 (defun mixi-post-diary-comment-page (diary)
   (concat "/add_comment.pl?&diary_id=" (mixi-diary-id diary)))
@@ -2394,6 +2428,7 @@ Increase this value when unexpected error frequently occurs."
          "&comm_id=" (mixi-community-id (mixi-event-community event))))
 
 ;; FIXME: Support photos.
+;;;###autoload
 (defun mixi-post-comment (parent content)
   "Post a comment to PARENT."
   (unless (mixi-object-p parent)
@@ -2470,7 +2505,7 @@ Increase this value when unexpected error frequently occurs."
 (defconst mixi-message-title-regexp
 "<font COLOR=#996600>·ï\\(¡¡\\|&nbsp;\\)̾</font>&nbsp;:&nbsp;\\(.*\\)\n?</td>")
 (defconst mixi-message-content-regexp
-  "<tr><td CLASS=h120>\\(.*\\)</td></tr>")
+  "<tr><td CLASS=h120 width=\"500\">\\(.*\\)</td></tr>")
 
 (defun mixi-realize-message (message)
   "Realize a MESSAGE."
@@ -2568,6 +2603,7 @@ Increase this value when unexpected error frequently occurs."
 (defconst mixi-message-list-regexp
   "<td><a HREF=\"view_message\\.pl\\?id=\\(.+\\)&box=\\(.+\\)\">")
 
+;;;###autoload
 (defun mixi-get-messages (&rest box-or-range)
   "Get messages of BOX."
   (when (> (length box-or-range) 2)
@@ -2597,6 +2633,7 @@ Increase this value when unexpected error frequently occurs."
 (defconst mixi-post-message-succeed-regexp
   "<b>Á÷¿®´°Î»</b>¤·¤Þ¤·¤¿¡£")
 
+;;;###autoload
 (defun mixi-post-message (friend title content)
   "Post a message to FRIEND."
   (unless (mixi-friend-p friend)
@@ -2693,6 +2730,7 @@ Increase this value when unexpected error frequently occurs."
 </td>
 </tr>")
 
+;;;###autoload
 (defun mixi-get-introductions (&rest friend-or-range)
   "Get introductions of FRIEND."
   (when (> (length friend-or-range) 2)
@@ -2743,8 +2781,11 @@ Increase this value when unexpected error frequently occurs."
   `(concat "http://news.mixi.jp/view_news.pl?id=" (mixi-news-id ,news)
           "&media_id=" (mixi-news-media-id ,news)))
 
+
+(defconst mixi-news-finished-regexp
+  "<td ALIGN=center background=http://img\\.mixi\\.jp/img/bg_line\\.gif> ¿½¤·Ìõ¤´¤¶¤¤¤Þ¤»¤ó¤¬¡¢¤³¤Î¥Ë¥å¡¼¥¹¤Ï·ÇºÜ½ªÎ»¤·¤Þ¤·¤¿¡£</td>")
 (defconst mixi-news-title-regexp
-  "<td HEIGHT=\"46\" STYLE=\"font-weight: bold;font-size: 14px;\" CLASS=\"h130\">\\(.+\\)\\(\r
+  "<td HEIGHT=\"46\" STYLE=\"font-weight: bold;font-size: 14px;\" CLASS=\"h130\">\\(.+\\)\\(
 \\)?</td>")
 (defconst mixi-news-media-time-regexp
   "<td COLSPAN=\"2\" ALIGN=\"right\">(\\(.+\\)&nbsp;-&nbsp;\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\))</td></tr>")
@@ -2763,26 +2804,28 @@ Increase this value when unexpected error frequently occurs."
   ;; FIXME: Check a expiration of cache?
   (unless (mixi-object-realized-p news)
     (with-mixi-retrieve (mixi-news-page news)
-      (if (re-search-forward mixi-news-title-regexp nil t)
-         (mixi-news-set-title news (match-string 1))
-       (mixi-realization-error 'cannot-find-title news))
-      (if (re-search-forward mixi-news-media-time-regexp nil t)
-         (progn
-           (mixi-news-set-media news (match-string 1))
-           (let ((year (nth 5 (decode-time (current-time))))
-                 (month (nth 4 (decode-time (current-time))))
-                 (month-of-item (string-to-number (match-string 2))))
-             (when (> month-of-item month)
-               (decf year))
-             (mixi-news-set-time
-              news (encode-time 0 (string-to-number (match-string 5))
-                                (string-to-number (match-string 4))
-                                (string-to-number (match-string 3))
-                                month year))))
-       (mixi-realization-error 'cannot-find-media-time news))
-      (if (re-search-forward mixi-news-content-regexp nil t)
-         (mixi-news-set-content news (match-string 1))
-       (mixi-realization-error 'cannot-find-content news)))
+      (if (re-search-forward mixi-news-finished-regexp nil t)
+         (mixi-news-set-content news (match-string 0))
+       (if (re-search-forward mixi-news-title-regexp nil t)
+           (mixi-news-set-title news (match-string 1))
+         (mixi-realization-error 'cannot-find-title news))
+       (if (re-search-forward mixi-news-media-time-regexp nil t)
+           (progn
+             (mixi-news-set-media news (match-string 1))
+             (let ((year (nth 5 (decode-time (current-time))))
+                   (month (nth 4 (decode-time (current-time))))
+                   (month-of-item (string-to-number (match-string 2))))
+               (when (> month-of-item month)
+                 (decf year))
+               (mixi-news-set-time
+                news (encode-time 0 (string-to-number (match-string 5))
+                                  (string-to-number (match-string 4))
+                                  (string-to-number (match-string 3))
+                                  month year))))
+         (mixi-realization-error 'cannot-find-media-time news))
+       (if (re-search-forward mixi-news-content-regexp nil t)
+           (mixi-news-set-content news (match-string 1))
+         (mixi-realization-error 'cannot-find-content news))))
     (mixi-object-touch news)))
 
 (defun mixi-news-media-id (news)
@@ -2895,6 +2938,7 @@ Increase this value when unexpected error frequently occurs."
 <td WIDTH=\"1%\" nowrap CLASS=\"f08\"><A HREF=\"list_news_media\\.pl\\?id=[0-9]+\">\\(.+\\)</A></td>
 <td WIDTH=\"1%\" nowrap CLASS=\"f08\">\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\)</td></tr>")
 
+;;;###autoload
 (defun mixi-get-news (category sort &optional range)
   "Get news of CATEGORY and SORT."
   (unless (mixi-news-category-p category)