Search code examples
ruby-on-railsfacebook-graph-apifb-graph

Publish open graph story in facebook using ruby (fb_graph)?


I use fb_graph to create a post in facebook account. It works fine.

 me = FbGraph::User.me(session[:fb_token])
 me.feed!( :message => 'This is test message', :link => 'http://site.com', :name => 'Sports', :description => "Manish placed a bet on India vs England on Sports.com")

But Now, I need to post a story in facebook using fb_graph API. Can any buddy help!

Like in iOs: http://developers.facebook.com/docs/tutorials/ios-sdk-tutorial/publish-open-graph-story/

and in ruby gem fb_graph I found some code related with Story: https://github.com/nov/fb_graph/search?q=story&ref=cmdform

It means fb_graph should support open-graph story.


Solution

  • It's given in their wiki

    # Publish an activity
    action = me.og_action!(
      app.og_action(:custom_action), # or simply "APP_NAMESPACE:ACTION" as String
      :custom_object => 'http://samples.ogp.me/264755040233381'
    )
    

    https://github.com/nov/fb_graph/wiki/OpenGraph