==== Atom Publishing Protocol ==== 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: * [[http://trac.wordpress.org/ticket/8829|#8829]]: Use 'the_category_rss' template function in Atompub backend (integrated in WP 2.8) * [[http://trac.wordpress.org/ticket/8828|#8828]]: Tags and Categories are undifferentiable in Atom and RSS feeds * [[http://trac.wordpress.org/ticket/8827|#8827]]: Add 'app_create_post' and 'app_put_post' hooks in Atompub backend (integrated in WP 2.8) * [[http://trac.wordpress.org/ticket/8826|#8826]]: Support 'atom_ns' 'atom_head' & 'atom_entry' hooks in Atompub backend (integrated in WP 3.0) Once done, you can use Atompub naturally to read, add, update and delete entries. The only details to know are that: * the main URL should be expressed using an Atom link with rel='related' * tags are Atom categories with a scheme='urn:tag' or containing '/tag/' bmPress social bookmarking for the Wordpress platform === Examples using Zend Framework === === Adding a bookmark === $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); ==== XML-RPC ==== === metaWeblog.newPost === To post an a new bookmark, you can use this method with the following struct parameters: * **title**: the bookmark title * **description**: the bookmark description/content * **mt_keywords**: the bookmark tags, comma separated * **custom_fields**: an array containing this parameters * key: **related**, value: the bookmark main URL * key: **via**, value: the bookmark via URL * key: **screenshot**, value: the bookmark thumbnail URL 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) )); * [[http://www.writers.ph|freelance writing jobs]]