views:

30

answers:

2

After some digging around with the Wordpress XML-RPC documentation, it seems that there isn't a way to remotely obtain a "post" (such as a news article) through the XML-RPC interface. The documentation only mentions wp.getPage - if I try and pass in a PostID to this method, it returns:

 [faultCode] => 404 [faultString] => Sorry, no such page. 

... but wp.GetPage obviously does work when I pass a valid PageID. Does anyone have any ideas how I might go about solving this? Ideally, without extending the XML-RPC mechanism on the remote site (as access to these could be tricky)

A: 

See:

Wordpress XMLRPC API | Remote Control Wordpress

Sarfraz
Jamie Chapman
Unfortunately, this appears to be a paid plugin. Looking for something free really.
Jamie Chapman
+1  A: 

I managed to figure this out. You can do this by using the "blogger.getPost" method. There isn't much documentation for this on the Wordpress site, but if you check out xmlrpc.php in the root of the Wordpress directory you will find a complete list of XML-RPC functions, including:

        // Blogger API
        'blogger.getUsersBlogs' => 'this:blogger_getUsersBlogs',
        'blogger.getUserInfo' => 'this:blogger_getUserInfo',
        'blogger.getPost' => 'this:blogger_getPost',
        'blogger.getRecentPosts' => 'this:blogger_getRecentPosts',
        'blogger.getTemplate' => 'this:blogger_getTemplate',
        'blogger.setTemplate' => 'this:blogger_setTemplate',
        'blogger.newPost' => 'this:blogger_newPost',
        'blogger.editPost' => 'this:blogger_editPost',
        'blogger.deletePost' => 'this:blogger_deletePost',

Hope this helps anyone who struggles with this in future.

Jamie Chapman