For Developers

OutputThis! is an intermediate service engine for the Structured Blogging weblogging tool plugins, but the service API can be accessed from any application.

At this time, OutputThis! only has an XML-RPC interface, with two methods exposed:

The first is outputthis.getPublishedTargets, which will return a list of targets for a given username and password. It takes two parameters, strings: the first is the user's outputthis login username; the second is the password for the username. If the username and password don't validate, a 403 error is returned.

As an example, following is how this service would be accessed using Simon Willison's Incutio XML-RPC Library:

// Specifying a server by URL (port 80 is assumed):
$client = new IXR_Client('http://outputthis.org/xmlrpc.php');

if (!$client->query('outputthis.getPublishedTargets', 'someuser', 'somepassword')) {
    die('Something went wrong - '.$client->getErrorCode().' : '.$client->getErrorMessage());
}
$targets = $client->getResponse();

echo '<pre>'; print_r($targets); echo '</pre>';

The second method is outputthis.publishPost, which will publish a specific post to one or more targets, specified in a structure. Following is an example of how this is used (note that though the Blogger API as defined through Blogger doesn't accept a title, the structure shown in the parameters is what's necessary and expected. You don't have to have title for the Blogger API, but you do need the structure.):

$params = array('title' => 'Trying Atom', 'description' => 'testing');
$requests[0] = array('ID'=>'5', 'status' => 'publish');
$requests[1] = array('ID'=>'4', 'status' => 'publish');

if (!$client->query('outputthis.publishPost', 'someuser', 'somepass', $requests, $params)) {
    die('Something went wrong - '.$client->getErrorCode().' : '.$client->getErrorMessage());
}

Note that the only time a XML-RPC error is returned with this method call is if the username/login are incorrect. Otherwise, you need to check the report table to see what errors happened in this request, because multiple services might be targetted, and some work, some not.

Version 1.0 of OutputThis will have REST support.

Acknowledgements

Simon's Inutio XML-RPC Library is what's fueling the XML-RPC engine in OutputThis! It's incredibly intuitive and very easy to work with, and we're grateful for his efforts. When Simon releases 1.7 of the library, we'll upgrade.

For the Atom processing, we're using DentedReality's PHP Atom API, again, easy to use, and used thankfully.