From: bg66 Date: Tue, 12 Dec 2006 05:38:43 +0000 (+0000) Subject: * mixi.el (mixi-url-retrieve): Simplify. X-Git-Tag: mixi-el-1_0_0~164 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=c156ca699f76306ad9ea0ed05baa2627e7151fec;p=elisp%2Fmixi.git * mixi.el (mixi-url-retrieve): Simplify. --- diff --git a/ChangeLog b/ChangeLog index d54eff8..cc32084 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-12-12 OHASHI Akira + + * mixi.el (mixi-url-retrieve): Simplify. + 2006-12-11 OHASHI Akira * mixi.el (mixi-diary-time-regexp): Follow the change of mixi; diff --git a/mixi.el b/mixi.el index a274a2c..de696d0 100644 --- a/mixi.el +++ b/mixi.el @@ -254,20 +254,14 @@ Increase this value when unexpected error frequently occurs." (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 - (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) - (error (mixi-message "Cannot retrieve"))) - (search-forward "\n\n") - (setq ret (decode-coding-string - (buffer-substring-no-properties (point) (point-max)) - mixi-coding-system)) - (kill-buffer buffer) - (setq ret (mixi-parse-buffer url ret post-data)))) - ret)) + (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") + (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)) + (kill-buffer buffer) + (mixi-parse-buffer url ret post-data)))) (defun mixi-w3m-retrieve (url &optional post-data) "Retrieve the URL and return gotten strings."