* mixi.el (mixi-news-title-regexp): Follow the change of mixi.
[elisp/mixi.git] / mixi.el
diff --git a/mixi.el b/mixi.el
index 271ff27..dac2570 100644 (file)
--- a/mixi.el
+++ b/mixi.el
@@ -546,16 +546,6 @@ Increase this value when unexpected error frequently occurs."
          object))
     exp))
 
-(defun mixi-realize-object (object &optional page)
-  "Realize a OBJECT."
-  (unless (mixi-object-p object)
-    (signal 'wrong-type-argument (list 'mixi-object-p object)))
-  (let ((func (intern (concat mixi-object-prefix "realize-"
-                             (mixi-object-name object)))))
-    (if page
-       (funcall func object page)
-      (funcall func object))))
-
 (defun mixi-object-timestamp (object)
   "Return the timestamp of OJBECT."
   (unless (mixi-object-p object)
@@ -1408,7 +1398,7 @@ Increase this value when unexpected error frequently occurs."
   "<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>")
+<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
@@ -2113,6 +2103,19 @@ Increase this value when unexpected error frequently occurs."
                           (nth 1 item)))))
            items)))
 
+;; Parent object.
+(defmacro mixi-parent-p (object)
+  `(or (eq (mixi-object-class ,object) 'mixi-diary)
+       (mixi-bbs-p object)))
+
+(defun mixi-realize-parent (parent &optional page)
+  "Realize a PARENT."
+  (unless (mixi-parent-p parent)
+    (signal 'wrong-type-argument (list 'mixi-parent-p parent)))
+  (let ((func (intern (concat mixi-object-prefix "realize-"
+                             (mixi-object-name parent)))))
+    (funcall func parent page)))
+
 ;; Comment object.
 (defun mixi-make-comment (parent owner time content)
   "Return a comment object."
@@ -2246,8 +2249,8 @@ Increase this value when unexpected error frequently occurs."
 
 (defun mixi-get-comments (parent &optional range)
   "Get comments of PARENT."
-  (unless (mixi-object-p parent)
-    (signal 'wrong-type-argument (list 'mixi-object-p parent)))
+  (unless (mixi-parent-p parent)
+    (signal 'wrong-type-argument (list 'mixi-parent-p parent)))
   (let* ((name (mixi-object-name parent))
         (list-page (intern (concat mixi-object-prefix name
                                    "-comment-list-page")))
@@ -2255,7 +2258,7 @@ Increase this value when unexpected error frequently occurs."
                                       "-comment-list-regexp"))))
         (page (funcall list-page parent)))
     (unless (mixi-object-realized-p parent)
-      (mixi-realize-object parent page)
+      (mixi-realize-parent parent page)
       (setq page nil))
     (let ((items (mixi-get-matched-items page regexp range t)))
       (mapcar (lambda (item)
@@ -2648,15 +2651,17 @@ Increase this value when unexpected error frequently occurs."
           "&media_id=" (mixi-news-media-id ,news)))
 
 (defconst mixi-news-title-regexp
-  "<td HEIGHT=\"46\" STYLE=\"font-weight: bold;font-size: 14px;\" CLASS=\"h130\">\\(.+\\)</td>")
+  "<td HEIGHT=\"46\" STYLE=\"font-weight: bold;font-size: 14px;\" CLASS=\"h130\">\\(.+\\)\\(\r
+\\)?</td>")
 (defconst mixi-news-media-time-regexp
   "<td COLSPAN=\"2\" ALIGN=\"right\">(\\(.+\\)&nbsp;-&nbsp;\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\):\\([0-9]+\\))</td></tr>")
 (defconst mixi-news-content-regexp
   "<td CLASS=\"h150\">
 
 \\(.+\\)
-
-?
+<br>
+\\(.*
+\\)?
 
 \\(</td>\\|<br>\\)")