bmPress aim to support Atompub as its primary API.
For now, Wordpress needs to be patched with the following patches so that everything works correctly. This patches allow plugins to process Atompub requests and add tags handling in the Wordpress Atompub backend:
Once done, you can use Atompub naturally to read, add, update and delete entries.
The only details to know are that:
<entry xmlns="http://www.w3.org/2005/Atom"> <title>bmPress</title> <content type="text">social bookmarking for the Wordpress platform</content> <link rel="related" type="text/html" href="http://bmpress.org/"/> <category scheme="http://demo.bmpress.org/category/" term="blogmarks" label="Blogmarks"/> <category scheme="urn:tag" term="social-bookmarking" label="social bookmarking"/> <category scheme="http://demo.bmpress.org/tag/" term="wordpress" label="wordpress"/> </entry>
$authenticatedHttpClient = new Zend_Http_Client(); $authenticatedHttpClient->setAuth('joe', 'XXXXXX'); $gdata = new Zend_Gdata($authenticatedHttpClient); $baseUrl = 'http://demo.bmpress.org'; $endpoint = $baseUrl . '/wp-app.php/posts'; $entry = $gdata->newEntry(); $entry->title = $gdata->newTitle('bmPress'); $entry->content = $gdata->newContent('social bookmarking for the Wordpress platform')->setType('text'); $entry->setLink(array( new Zend_Gdata_App_Extension_Link('http://bmpress.org/', 'related') )); $entry->setCategory(array( new Zend_Gdata_App_Extension_Category('wordpress', $baseUrl . '/tag/'), new Zend_Gdata_App_Extension_Category('social-bookmarking', 'urn:tag', 'social bookmarking') )); $result = $gdata->insertEntry($entry, $endpoint);
To post an a new bookmark, you can use this method with the following struct parameters:
Example using the Zend Framework:
$client = new Zend_XmlRpc_Client('http://demo.bmpress.org/xmlrpc.php'); $client->call('metaWeblog.newPost', array( 0, // 0 - blog ID 'joe', // 1 - login 'XXXXXX', // 2 - password array( // 3 - content struct 'title' => 'bmPress', // title 'description' => 'social bookmarking for the Wordpress platform', // content 'mt_keywords' => 'wordpress, social bookmarking', // tags 'custom_fields' => array( // metas array('key' => 'related', 'value' => 'http://bmpress.org/') // - URL ) ), true // 4 - publish (draft if not true) ));