emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* xml-rpc-request error for wordpress
@ 2015-01-18  0:23 Shiyuan
  2015-01-18 13:59 ` Alex Kost
  0 siblings, 1 reply; 4+ messages in thread
From: Shiyuan @ 2015-01-18  0:23 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org, help-gnu-emacs

Hi all,
I have been using org2blog/wp package to manage my wordpress blog. It had
been woking very well until last week when things started to fail.
 org2blog/wp uses xml-rpc-request to connect to wordpress.com which returns
the 301 Error.  I haven't changed my emacs config for quite a long time. So
I guess something might have happened on the wordpress side or some emacs
packages break something.  I have googled around but cannot find any
relevant info.  I don't have too much experience about xml-rpc. Any help
about debugging this issue would be appreciated. The traceback is attached.
I can login wordpress and maintain my blog through the browser and web
interface.  Thanks.

------------------------------------
 signal(error ("Error during request: 301"))
  error("Error during request: %s" 301)
  (progn (error "Error during request: %s" url-http-response-status))
  (if (> url-http-response-status 299) (progn (error "Error during request:
%s" url-http-response-status)))
  (save-current-buffer (set-buffer buffer) (if (not (numberp
url-http-response-status)) (progn (error "Why? url-http-response-status is
%s" url-http-response-status))) (if (> url-http-response-status 299) (progn
(error "Error during request: %s" url-http-response-status))))
  (let ((buffer (url-retrieve-synchronously server-url)))
(save-current-buffer (set-buffer buffer) (if (not (numberp
url-http-response-status)) (progn (error "Why? url-http-response-status is
%s" url-http-response-status))) (if (> url-http-response-status 299) (progn
(error "Error during request: %s" url-http-response-status))))
(xml-rpc-request-process-buffer buffer))
  (if async-callback-function (url-retrieve server-url
async-callback-function) (let ((buffer (url-retrieve-synchronously
server-url))) (save-current-buffer (set-buffer buffer) (if (not (numberp
url-http-response-status)) (progn (error "Why? url-http-response-status is
%s" url-http-response-status))) (if (> url-http-response-status 299) (progn
(error "Error during request: %s" url-http-response-status))))
(xml-rpc-request-process-buffer buffer)))
  (cond ((boundp (quote url-be-asynchronous)) (if async-callback-function
(setq url-be-asynchronous t url-current-callback-data (list
async-callback-function (current-buffer)) url-current-callback-func (quote
xml-rpc-request-callback-handler)) (setq url-be-asynchronous nil))
(url-retrieve server-url t) (if (not url-be-asynchronous) (progn (let
((result (xml-rpc-request-process-buffer ...))) (if (> xml-rpc-debug 1)
(progn (print result ...))) result)))) (t (if async-callback-function
(url-retrieve server-url async-callback-function) (let ((buffer
(url-retrieve-synchronously server-url))) (save-current-buffer (set-buffer
buffer) (if (not (numberp url-http-response-status)) (progn (error "Why?
url-http-response-status is %s" url-http-response-status))) (if (>
url-http-response-status 299) (progn (error "Error during request: %s"
url-http-response-status)))) (xml-rpc-request-process-buffer buffer)))))
  (let ((url-request-method "POST") (url-package-name "xml-rpc.el")
(url-package-version xml-rpc-version) (url-request-data (concat "<?xml
version=\"1.0\"" " encoding=\"UTF-8\"?>\n" (let ((temp-buffer
(generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer
temp-buffer) (unwind-protect (progn ... ... ...) (and ... ...)))) "\n"))
(url-mime-charset-string "utf-8;q=1, iso-8859-1;q=0.5")
(url-request-coding-system xml-rpc-use-coding-system)
(url-http-attempt-keepalives nil) (url-request-extra-headers (list (cons
"Connection" "close") (cons "Content-Type" "text/xml; charset=utf-8"))))
(if (> xml-rpc-debug 1) (progn (print url-request-data (create-file-buffer
"request-data")))) (cond ((boundp (quote url-be-asynchronous)) (if
async-callback-function (setq url-be-asynchronous t
url-current-callback-data (list async-callback-function (current-buffer))
url-current-callback-func (quote xml-rpc-request-callback-handler)) (setq
url-be-asynchronous nil)) (url-retrieve server-url t) (if (not
url-be-asynchronous) (progn (let ((result ...)) (if (> xml-rpc-debug 1)
(progn ...)) result)))) (t (if async-callback-function (url-retrieve
server-url async-callback-function) (let ((buffer
(url-retrieve-synchronously server-url))) (save-current-buffer (set-buffer
buffer) (if (not ...) (progn ...)) (if (> url-http-response-status 299)
(progn ...))) (xml-rpc-request-process-buffer buffer))))))
  (save-excursion (let ((url-request-method "POST") (url-package-name
"xml-rpc.el") (url-package-version xml-rpc-version) (url-request-data
(concat "<?xml version=\"1.0\"" " encoding=\"UTF-8\"?>\n" (let
((temp-buffer ...)) (save-current-buffer (set-buffer temp-buffer)
(unwind-protect ... ...))) "\n")) (url-mime-charset-string "utf-8;q=1,
iso-8859-1;q=0.5") (url-request-coding-system xml-rpc-use-coding-system)
(url-http-attempt-keepalives nil) (url-request-extra-headers (list (cons
"Connection" "close") (cons "Content-Type" "text/xml; charset=utf-8"))))
(if (> xml-rpc-debug 1) (progn (print url-request-data (create-file-buffer
"request-data")))) (cond ((boundp (quote url-be-asynchronous)) (if
async-callback-function (setq url-be-asynchronous t
url-current-callback-data (list async-callback-function (current-buffer))
url-current-callback-func (quote xml-rpc-request-callback-handler)) (setq
url-be-asynchronous nil)) (url-retrieve server-url t) (if (not
url-be-asynchronous) (progn (let (...) (if ... ...) result)))) (t (if
async-callback-function (url-retrieve server-url async-callback-function)
(let ((buffer ...)) (save-current-buffer (set-buffer buffer) (if ... ...)
(if ... ...)) (xml-rpc-request-process-buffer buffer)))))))
  (unwind-protect (save-excursion (let ((url-request-method "POST")
(url-package-name "xml-rpc.el") (url-package-version xml-rpc-version)
(url-request-data (concat "<?xml version=\"1.0\"" " encoding=\"UTF-8\"?>\n"
(let (...) (save-current-buffer ... ...)) "\n")) (url-mime-charset-string
"utf-8;q=1, iso-8859-1;q=0.5") (url-request-coding-system
xml-rpc-use-coding-system) (url-http-attempt-keepalives nil)
(url-request-extra-headers (list (cons "Connection" "close") (cons
"Content-Type" "text/xml; charset=utf-8")))) (if (> xml-rpc-debug 1) (progn
(print url-request-data (create-file-buffer "request-data")))) (cond
((boundp (quote url-be-asynchronous)) (if async-callback-function (setq
url-be-asynchronous t url-current-callback-data (list
async-callback-function ...) url-current-callback-func (quote
xml-rpc-request-callback-handler)) (setq url-be-asynchronous nil))
(url-retrieve server-url t) (if (not url-be-asynchronous) (progn (let ...
... result)))) (t (if async-callback-function (url-retrieve server-url
async-callback-function) (let (...) (save-current-buffer ... ... ...)
(xml-rpc-request-process-buffer buffer))))))))
  xml-rpc-request("http://myname.wordpress.com/xmlrpc.php" ((methodCall nil
(methodName nil "metaWeblog.getCategories") (params nil (param nil (value
nil (string nil "1"))) (param nil (value nil (string nil "myname"))) (param
nil (value nil (string nil "######")))))) nil)
  (let* ((m-name (if (stringp method) method (symbol-name method)))
(m-params (mapcar (function (lambda (p) (list (quote param) nil (car
...)))) (if async-callback-func params (car-safe params)))) (m-func-call
(list (list (quote methodCall) nil (list (quote methodName) nil m-name)
(append (quote (params nil)) m-params))))) (if (> xml-rpc-debug 1) (progn
(print m-func-call (create-file-buffer "func-call")))) (xml-rpc-request
server-url m-func-call async-callback-func))
  xml-rpc-method-call-async(nil "http://myname.wordpress.com/xmlrpc.php"
"metaWeblog.getCategories" ("1" "myname" "######"))
  (let ((response (xml-rpc-method-call-async nil server-url method
params))) (cond ((stringp response) (list (cons nil (concat "URL/HTTP
Error: " response)))) (t (xml-rpc-xml-to-response response))))
  xml-rpc-method-call("http://myname.wordpress.com/xmlrpc.php"
"metaWeblog.getCategories" "1" "myname" "######")
  metaweblog-get-categories("http://myname.wordpress.com/xmlrpc.php"
"myname" "######" "1")
  (mapcar (function (lambda (category) (cdr (assoc "categoryName"
category)))) (metaweblog-get-categories org2blog/wp-server-xmlrpc-url
org2blog/wp-server-userid org2blog/wp-server-pass
org2blog/wp-server-blogid))
  (setq org2blog/wp-blog (assoc org2blog/wp-blog-name
org2blog/wp-blog-alist) org2blog/wp-server-xmlrpc-url (plist-get (cdr
org2blog/wp-blog) :url) org2blog/wp-server-userid (eval (plist-get (cdr
org2blog/wp-blog) :username)) org2blog/wp-server-blogid (or (plist-get (cdr
org2blog/wp-blog) :id) "1") org2blog/wp-server-pass (or (eval (plist-get
(cdr org2blog/wp-blog) :password)) (read-passwd (format "%s Weblog
password? " org2blog/wp-blog-name))) org2blog/wp-categories-list (mapcar
(function (lambda (category) (cdr (assoc "categoryName" category))))
(metaweblog-get-categories org2blog/wp-server-xmlrpc-url
org2blog/wp-server-userid org2blog/wp-server-pass
org2blog/wp-server-blogid)) org2blog/wp-tags-list (mapcar (function (lambda
(tag) (cdr (assoc "slug" tag)))) (wp-get-tags org2blog/wp-server-xmlrpc-url
org2blog/wp-server-userid org2blog/wp-server-pass
org2blog/wp-server-blogid)) org2blog/wp-pages-list (mapcar (function
(lambda (pg) (cons (cdr (assoc "page_title" pg)) (cdr (assoc "page_id"
pg))))) (wp-get-pagelist org2blog/wp-server-xmlrpc-url
org2blog/wp-server-userid org2blog/wp-server-pass
org2blog/wp-server-blogid)))
  (let nil (setq org2blog/wp-blog-name (or blog-name (and (equal (length
org2blog/wp-blog-alist) 1) (car (car org2blog/wp-blog-alist)))
(completing-read "Blog to login into? ([Tab] to see list): " (mapcar (quote
car) org2blog/wp-blog-alist) nil t))) (if (> (length org2blog/wp-blog-name)
1) nil (error "Invalid blog name")) (setq org2blog/wp-blog (assoc
org2blog/wp-blog-name org2blog/wp-blog-alist) org2blog/wp-server-xmlrpc-url
(plist-get (cdr org2blog/wp-blog) :url) org2blog/wp-server-userid (eval
(plist-get (cdr org2blog/wp-blog) :username)) org2blog/wp-server-blogid (or
(plist-get (cdr org2blog/wp-blog) :id) "1") org2blog/wp-server-pass (or
(eval (plist-get (cdr org2blog/wp-blog) :password)) (read-passwd (format
"%s Weblog password? " org2blog/wp-blog-name))) org2blog/wp-categories-list
(mapcar (function (lambda (category) (cdr (assoc "categoryName"
category)))) (metaweblog-get-categories org2blog/wp-server-xmlrpc-url
org2blog/wp-server-userid org2blog/wp-server-pass
org2blog/wp-server-blogid)) org2blog/wp-tags-list (mapcar (function (lambda
(tag) (cdr (assoc "slug" tag)))) (wp-get-tags org2blog/wp-server-xmlrpc-url
org2blog/wp-server-userid org2blog/wp-server-pass
org2blog/wp-server-blogid)) org2blog/wp-pages-list (mapcar (function
(lambda (pg) (cons (cdr (assoc "page_title" pg)) (cdr (assoc "page_id"
pg))))) (wp-get-pagelist org2blog/wp-server-xmlrpc-url
org2blog/wp-server-userid org2blog/wp-server-pass
org2blog/wp-server-blogid))) (setq org2blog/wp-logged-in t) (message
"Logged in"))
  org2blog/wp-login("wordpress")
  (if org2blog/wp-logged-in nil (org2blog/wp-login blog-name))
  (let ((blog-name (org2blog/wp-get-blog-name))) (if (and blog-name (not
(equal blog-name org2blog/wp-blog-name))) (progn (org2blog/wp-logout))) (if
org2blog/wp-logged-in nil (org2blog/wp-login blog-name)))
  org2blog/wp-correctly-login()
  org2blog/wp-post-buffer(t)
  org2blog/wp-post-buffer-and-publish()
  call-interactively(org2blog/wp-post-buffer-and-publish record nil)
  command-execute(org2blog/wp-post-buffer-and-publish record)
  execute-extended-command(nil "org2blog/wp-post-buffer-and-publish")
  call-interactively(execute-extended-command nil nil)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: xml-rpc-request error for wordpress
  2015-01-18  0:23 xml-rpc-request error for wordpress Shiyuan
@ 2015-01-18 13:59 ` Alex Kost
  2015-01-22  6:33   ` Puneeth Chaganti
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Kost @ 2015-01-18 13:59 UTC (permalink / raw)
  To: Shiyuan; +Cc: help-gnu-emacs, emacs-orgmode@gnu.org

Shiyuan (2015-01-18 03:23 +0300) wrote:

> Hi all,
> I have been using org2blog/wp package to manage my wordpress blog. It had
> been woking very well until last week when things started to fail.
>  org2blog/wp uses xml-rpc-request to connect to wordpress.com which returns
> the 301 Error.  I haven't changed my emacs config for quite a long time. So
> I guess something might have happened on the wordpress side or some emacs
> packages break something.  I have googled around but cannot find any
> relevant info.  I don't have too much experience about xml-rpc. Any help
> about debugging this issue would be appreciated. The traceback is attached.
> I can login wordpress and maintain my blog through the browser and web
> interface.  Thanks.

Not sure, but as I saw "POST" and "Error during request: 301" in your
backtrace, I think it may be the same as the bug 16960: <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16960>.

-- 
Alex

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: xml-rpc-request error for wordpress
  2015-01-18 13:59 ` Alex Kost
@ 2015-01-22  6:33   ` Puneeth Chaganti
  2015-01-22 19:20     ` Shiyuan
  0 siblings, 1 reply; 4+ messages in thread
From: Puneeth Chaganti @ 2015-01-22  6:33 UTC (permalink / raw)
  To: Alex Kost; +Cc: emacs-orgmode@gnu.org, Shiyuan

Shiyuan,

Wordpress has moved all the blogs to https.  You will need to change
your blog's url to "https://myname.wordpress.com/xmlrpc.php" instead
of using http://.

See: https://github.com/punchagan/org2blog/issues/177

Best,
Puneeth

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: xml-rpc-request error for wordpress
  2015-01-22  6:33   ` Puneeth Chaganti
@ 2015-01-22 19:20     ` Shiyuan
  0 siblings, 0 replies; 4+ messages in thread
From: Shiyuan @ 2015-01-22 19:20 UTC (permalink / raw)
  To: Puneeth Chaganti; +Cc: Alex Kost, emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 420 bytes --]

Changing the blog's url  to https solves the problem.  Thank you Puneeth.

Shiyuan

On Wed, Jan 21, 2015 at 10:33 PM, Puneeth Chaganti <punchagan@gmail.com>
wrote:

> Shiyuan,
>
> Wordpress has moved all the blogs to https.  You will need to change
> your blog's url to "https://myname.wordpress.com/xmlrpc.php" instead
> of using http://.
>
> See: https://github.com/punchagan/org2blog/issues/177
>
> Best,
> Puneeth
>

[-- Attachment #2: Type: text/html, Size: 941 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-01-22 19:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-18  0:23 xml-rpc-request error for wordpress Shiyuan
2015-01-18 13:59 ` Alex Kost
2015-01-22  6:33   ` Puneeth Chaganti
2015-01-22 19:20     ` Shiyuan

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).