2006-12-01 OHASHI Akira <bg66@koka-in.org>
+ * mixi.el (mixi-topic-comment-list-page): Use `%d' instead of `all'.
+ (mixi-event-comment-list-page): Ditto.
+ (mixi-url-retrieve): Fix for `HTTP/1.0 500 Internal Server Error' of
+ BBS page.
+ (mixi-w3m-retrieve): Ditto.
+ (mixi-curl-retrieve): Ditto.
+
+2006-12-01 OHASHI Akira <bg66@koka-in.org>
+
* mixi.el (mixi-parse-buffer): Rename from `mixi-retrieve-1', and
swap `buffer' argument and `url'.
(mixi-url-retrieve): Follow the change above.
(error (mixi-message "Cannot retrieve")))
(with-current-buffer buffer
(goto-char (point-min))
- (if (re-search-forward "HTTP/[0-9.]+ 302 Moved" nil t)
+ (if (re-search-forward "HTTP/[0-9]+\\.[0-9]+ 302" nil t)
(if (re-search-forward
(concat "Location: " mixi-url "\\(.+\\)") nil t)
(setq ret (mixi-url-retrieve (match-string 1) post-data))
(setq ret (mixi-url-retrieve "/home.pl" post-data)))
- (unless (re-search-forward "HTTP/[0-9.]+ 200 OK" nil t)
+ ;; Allow `500' because BBS page might return
+ ;; `HTTP/1.0 500 Internal Server Error'.
+ (unless (looking-at "HTTP/[0-9]+\\.[0-9]+ [25]00")
(error (mixi-message "Cannot retrieve")))
- (search-forward "\n\n")
- (setq ret (decode-coding-string
- (buffer-substring-no-properties (point) (point-max))
- mixi-coding-system))
+ (delete-region (point) (re-search-forward "\r?\n\r?\n"))
+ (setq ret (decode-coding-string (buffer-string) mixi-coding-system))
(kill-buffer buffer)
(setq ret (mixi-parse-buffer url ret post-data))))
ret))
"Retrieve the URL and return gotten strings."
(let ((url (mixi-expand-url url)))
(with-temp-buffer
- (if (not (string= (w3m-retrieve url nil nil post-data) "text/html"))
- (error (mixi-message "Cannot retrieve"))
- (w3m-decode-buffer url)
- (let ((ret (buffer-substring-no-properties (point-min) (point-max))))
- (mixi-parse-buffer url ret post-data))))))
+ ;; Don't check return code of `w3m-retrieve' because BBS page might
+ ;; return `HTTP/1.0 500 Internal Server Error'.
+ (w3m-retrieve url nil nil post-data)
+ (w3m-decode-buffer url)
+ (mixi-parse-buffer url (buffer-string) post-data))))
(defun mixi-curl-retrieve (url &optional post-data)
"Retrieve the URL and return gotten strings."
(goto-char (point-min))
(while (looking-at "HTTP/[0-9]+\\.[0-9]+ [13][0-9][0-9]")
(delete-region (point) (re-search-forward "\r?\n\r?\n")))
- (unless (looking-at "HTTP/[0-9]+\\.[0-9]+ 200")
+ ;; Allow `500' because BBS page might return
+ ;; `HTTP/1.0 500 Internal Server Error'.
+ (unless (looking-at "HTTP/[0-9]+\\.[0-9]+ [25]00")
(error (mixi-message "Cannot retrieve")))
(delete-region (point) (re-search-forward "\r?\n\r?\n"))
(setq ret (decode-coding-string (buffer-string) mixi-coding-system))
</td></tr></table>")
(defun mixi-topic-comment-list-page (topic)
- (concat "/view_bbs.pl?page=all"
+ (concat "/view_bbs.pl?page=%d"
"&id=" (mixi-topic-id topic)
"&comm_id=" (mixi-community-id (mixi-topic-community topic))))
</tr>")
(defun mixi-event-comment-list-page (event)
- (concat "/view_event.pl?page=all"
+ (concat "/view_event.pl?page=%d"
"&id=" (mixi-event-id event)
"&comm_id=" (mixi-community-id (mixi-event-community event))))