使用ruby(fb_graph)在facebook上发布开放图形故事?

时间:2013-06-16 05:49:32

标签: ruby-on-rails facebook-graph-api fb-graph

我使用fb_graph在Facebook帐户中创建帖子。它工作正常。

 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")

但是现在,我需要使用fb_graph API在Facebook上发布一个故事。任何好友都可以帮忙!

与iOs一样: http://developers.facebook.com/docs/tutorials/ios-sdk-tutorial/publish-open-graph-story/

在ruby gem fb_graph中我发现了一些与Story相关的代码: https://github.com/nov/fb_graph/search?q=story&ref=cmdform

这意味着fb_graph应支持open-graph故事。

1 个答案:

答案 0 :(得分:2)

在他们的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