Skip to content

agerlic/facebook_realtime

Repository files navigation

Facebook RealTime

Facebook RealTime is a rails wrapper around facebook Real-time Update API.

Facebook Real-Time Update API

developers.facebook.com/docs/api/realtime

Facebook Graph API

For an overview of what this is all about, see developers.facebook.com/docs/api.

Installation

Create new Controller

Controller must inherit FacebookRealTime::SubscriptionsController

  • facebook_check is a callback URL to which Facebook will get subscription validation.

  • facebook_update is callback URL to which Facebook will post subscription updates.

Add two routes :get and :post

open your routes.rb and add

  • match ‘/endpoint’ => ‘controller_name#facebook_check’, :via => [:get]

  • match ‘/endpoint’ => ‘controller_name#facebook_update’, :via => [:post]

Create variables :

  • FB : facebook application id

  • FB : facebook application secret

  • FB : A subscriber-provided opaque token that will be echoed back in the verification request to assist the subscriber in identifying which subscription request is being verified. If this is not included, no token will be included in the verification request. This is from the PubSubHubbub spec.

Deploy your app

Before using gem you have to deploy a valid check method, to add new subscriptions

Use rake tasks :

  • rake fb:rt:list to show your subscriptions

  • rake fb:rt:delete to delete all your subscription

  • rake fb:rt:subscribe to add or a modify a subscription

  • params

    • object

      • facebook object name eg : user, …

    • fields:

      • list of fields with ‘,’ as separator eg : “likes, info”

    • callback_url:

      • url bringing to your check method

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages