OpenMicroBlogger.org

OpenMicroBlogger icon


Design your own Twitter API method for OpenMicroBlogger

OpenMicroBlogger now has a programmable API that you can configure, this short how-to will explain how to use the Site Admin to set up a new API method and expose it with Twitter style Basic Authentication.


In Site Admin you will find a new link:


image

Click New Method


image

Use these settings:

image

And finally, paste this code:



// get the named variables
extract( $vars );

// set the form post data
$request->set_param( 
  array( 'post', 'title' ),
  $request->status
);

// insert the status into the database
$resource->insert_from_post( $request );

// OK
header( 'Status: 200 OK' );



That's it! You have now exposed a new API method that posts a new Status, any user who is a registered member of the site can set their password and then use the method to post remotely.


If you're updating an older OMB, you will need to edit your config.yml to add the Password application for your users


image

Once that's done, click on Profile and you will see a "Password" App


image
image

The entire application's API is exposed as restful resources, that is how the Web app interacts with the back-end. You can now control through the new Rest API Group Permissions feature.




Sat Apr 4 10:50 PM










Sign In to post comments







Bookmark this:

Bookmark to Blinklist! Bookmark to Blogmarks! Bookmark to Del.icio.us! Bookmark to De.lirio.us! Bookmark to Digg! Bookmark to Fark! Bookmark to Furl! Bookmark to Ma.gnolia! Bookmark to Newsvine! Bookmark to Reddit! Bookmark to Scuttle! Bookmark to Simpy! Bookmark to Spurl! Bookmark to StumbleUpon! Bookmark to Technorati! Bookmark to Yahoo! My Web!






Support This Project

Keep tabs on this project by following Brian on Twitter: