sfSocialMediaPlugin - 1.0.0

Symfony plugin for easy social media stream integration

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 Dependencies Releases Changelog Contribute
Show source | Show as Markdown

Social media plugin to retrieve feeds from various sources (Twitter and Facebook currently) Useful for CMS and blogs to display a user(s) feed.

  • Add the following to your configuration (only those you are planning to use): facebook_api_key facebook_secret facebook_user_id twitter_username twitter_password foursquare_username foursquare_password

  • Also add the sf_absolute_url_root configuration setting to: http://www.yourhost.com/yourfolder/ of you will be using facebook

  • Add the facebook module to your settings.yml: all: .settings enabled_modules: facebook

  • Don't forget to enable the plugin in your configuration: $this->enablePlugins('sfSocialMediaPlugin');

  • You can overwrite the template for the facebook-success page by:

    • Creating a apps/frontend/modules/facebook/templates directory

    • Adding a doneSuccess.php to that folder

    • Customize it the way you want.

  • Facebook needs a session key and access to your account. This is done by visiting 2 urls:

    1. yourhost/facebook-init This will redirect you to facebook and you have to grant the application access to your profile.
    2. yourhost/facebook-success Once you've done step 1, this step retrieves your session key and stores it in the database.
  • The social media streams are to be added to a timeline, like so: $timeline = SMF::getStream(SMF::TWITTER); $this->timeline = $timeline;

  • Multiple social media messages can be added to a single timeline: $timeline = new Timeline(); $timeline = SMF::getStream(SMF::TWITTER, $timeline); $timeline = SMF::getStream(SMF::FACEBOOK, $timeline);

    $this->timeline = $timeline;

  • Order the timeline to date: $timeline->orderTimeline();

  • SMF is a shortcut class for SocialMediaFactory

  • getStream() is a shortcut method for getSocialMediaStream()