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: ![]() Click New Method ![]() Use these settings: ![]() 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 ![]() Once that's done, click on Profile and you will see a "Password" App ![]() ![]() 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:![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
|
|