* mixi.el (mixi-curl-post-form): New function.
authorbg66 <bg66>
Mon, 5 Feb 2007 10:24:19 +0000 (10:24 +0000)
committerbg66 <bg66>
Mon, 5 Feb 2007 10:24:19 +0000 (10:24 +0000)
(mixi-curl-retrieve): Add the FORM-DATA argument.
(mixi-message-title-regexp): Fix regexp.
(mixi-message-content-regexp): Ditto.

ChangeLog
mixi.el

index ca61fa0..199c9dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-02-05  OHASHI Akira  <bg66@koka-in.org>
+
+       * mixi.el (mixi-curl-post-form): New function.
+       (mixi-curl-retrieve): Add the FORM-DATA argument.
+       (mixi-message-title-regexp): Fix regexp.
+       (mixi-message-content-regexp): Ditto.
+
 2007-02-01  OHASHI Akira  <bg66@koka-in.org>
 
        * mixi.el (mixi-friend-nick-regexp): Follow the change of mixi.
diff --git a/mixi.el b/mixi.el
index 646b996..2c2f862 100644 (file)
--- a/mixi.el
+++ b/mixi.el
@@ -349,7 +349,7 @@ Increase this value when unexpected error frequently occurs."
   (let ((form-data (mixi-make-form-data fields)))
     (mixi-w3m-retrieve url form-data)))
 
-(defun mixi-curl-retrieve (url &optional post-data)
+(defun mixi-curl-retrieve (url &optional post-data form-data)
   "Retrieve the URL and return gotten strings."
   (with-temp-buffer
     (if (fboundp 'set-buffer-multibyte)
@@ -365,6 +365,7 @@ Increase this value when unexpected error frequently occurs."
                  (apply #'start-process "curl" (current-buffer)
                         mixi-curl-program
                         (append (if post-data '("-d" "@-"))
+                                form-data
                                 (list "-i" "-L" "-s"
                                       "-b" mixi-curl-cookie-file
                                       "-c" mixi-curl-cookie-file
@@ -385,6 +386,17 @@ Increase this value when unexpected error frequently occurs."
       (setq ret (decode-coding-string (buffer-string) mixi-coding-system))
       (mixi-parse-buffer url ret post-data))))
 
+(defun mixi-curl-post-form (url fields)
+  (let (form-data)
+    (mapcar (lambda (field)
+             (push "-F" form-data)
+             (push (concat (car field) "="
+                           (encode-coding-string (cdr field)
+                                                 mixi-coding-system))
+                   form-data))
+           fields)
+    (mixi-curl-retrieve url nil (reverse form-data))))
+
 (defconst mixi-my-id-regexp
   "<a href=\"add_diary\\.pl\\?id=\\([0-9]+\\)")
 
@@ -2456,9 +2468,9 @@ Increase this value when unexpected error frequently occurs."
 (defconst mixi-message-time-regexp
 "<font COLOR=#996600>Æü\\(¡¡\\|&nbsp;\\)ÉÕ</font>&nbsp;:&nbsp;\\([0-9]+\\)ǯ\\([0-9]+\\)·î\\([0-9]+\\)Æü \\([0-9]+\\)»þ\\([0-9]+\\)ʬ&nbsp;&nbsp;")
 (defconst mixi-message-title-regexp
-"<font COLOR=#996600>·ï\\(¡¡\\|&nbsp;\\)̾</font>&nbsp;:&nbsp;\\(.+\\)\n?</td>")
+"<font COLOR=#996600>·ï\\(¡¡\\|&nbsp;\\)̾</font>&nbsp;:&nbsp;\\(.*\\)\n?</td>")
 (defconst mixi-message-content-regexp
-  "<tr><td CLASS=h120>\\(.+\\)</td></tr>")
+  "<tr><td CLASS=h120>\\(.*\\)</td></tr>")
 
 (defun mixi-realize-message (message)
   "Realize a MESSAGE."