sfMicroBlogPlugin - 1.0.1

Tools to access microbloging sites.

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source | Show as Markdown

sfMicroBlog Plugin

Overview

sfMicroBlogPlugin provides a tool box to manipulate microbloging sites. Currently twitter (via username/password or oauth), [identi.ca] (or any other http://laconi.ca laconi.ca), [facebook] and http://ping.fm pingfm are supported.

NOTE: this is a very early version of this plugin. It works for me. use at your own risk.

Installation

To install sfMicroBlogPlugin:

./symfony plugin-install sfMicroBlogPlugin

To install from svn:

svn co http://svn.symfony-project.com/plugins/sfMicroBlogPlugin plugins/sfMicroBlogPlugin

Clear your cache

./symfony cc

Usage

The plugins includes other libraries to use twitter API and pingFM api. I slightly modified the twitter library to allow other urls and thus to use it on identi.ca.

Currently only the updateStatus function is properly wrapped:

    $options    = array('serviceName'   => 'twitter',
                'username'  => 'yourownusername',
                'password'  => 'yourownpassword',
                );
    $microblog  = new sfMicroBlog($options);
    $microblog->updateStatus("example of sfMicroblog update");

To build a sfMicroblog object for identica:

    $options    = array('serviceName'   => 'identica',
                'username'  => 'yourownusername',
                'password'  => 'yourownpassword',
                );

To build a sfMicroblog object for pingfm:

    $options    = array('serviceName'   => 'pingfm',
                'app_key'   => 'yourownappkey',
                'api_key'   => 'yourownapikey',
                );

To build a sfMicroblog object for twitter_oauth:

    $options    = array(
                'service'       => 'twitter_oauth',
                'consumer_key'      => 'yourownconsumerkey',
                'consumer_secret'   => 'yourownconsumersecret',
                'access_token'      => 'yourownaccesstoken',
                'access_token_secret'   => 'youtownaccesstokensecret'
            );

I just integrated the library from http://twitter.abrah.am/ it is a good source to determine how to obtain the access_token/access_token_secret from your users. consumer_key/consumer_secret may be obtained from twitter via https://twitter.com/oauth_clients

To build a sfMicroblog object for facebook:

    $options    = array(
                'service'   => 'facebook',
                'app_apikey'    => 'yourownapp_apikey',
                'app_secret'    => 'yourownapp_secret',
                'session_key'   => 'yourownsession_key',
                'uid'       => 'youtownuid'
            );

I just integrated the php library from facebook. http://developers.facebook.com/ for details on how to obtain app_apikey/app_secret for your application and how to get the session_key/uid of your users.

For twitter and identi.ca, added support for the source parameter.

If no options is given to the constructor, it attempts to read a configuration file in apps/yourapps/config/microblog.yml. You can find a sample of this convigation file in /plugins/sfMicroBlog/config/microblog.yml

TODO

  • To write a wrapper between them all when possible

License

For the full copyright and license information, please view the LICENSE file that was distributed with this source code.