From c156ca699f76306ad9ea0ed05baa2627e7151fec Mon Sep 17 00:00:00 2001 From: bg66 Date: Tue, 12 Dec 2006 05:38:43 +0000 Subject: [PATCH] * mixi.el (mixi-url-retrieve): Simplify. --- ChangeLog | 4 ++++ mixi.el | 22 ++++++++-------------- 2 files changed, 12 insertions(+), 14 deletions(-) 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." -- 1.7.10.4