ruby koala facebook graph geting public events

I want to get a list of events from a venues facebook page. There is code to configure koala at https://github.com/arsduo/koala. I setup a facebook App in Facebook and have app_id and app_secret but after much googleing cant work out where to get 'access_token = MY_TOKEN' or 'app_access_token = MY_APP_ACCESS_TOKEN'.

Ive looked at the Graph API Explorer (https://developers.facebook.com/tools/explorer) but cant seem to work out how to do it. For example one of the events pages is at https://www.facebook.com/pg/The-Old-England-186748738025516/events/?ref=page_internal.

Also example code on how to get the list would be great but the above world be a great start.


找到答案,这很简单:

Koala.config.api_version = 'v2.10'
oauth = Koala::Facebook::OAuth.new 'my_id', 'my_secret'
graph = Koala::Facebook::API.new oauth.get_app_access_token

fb_events = graph.get_object( '186748738025516/events' )
链接地址: http://www.djcxy.com/p/5588.html

上一篇: Facebook图形API停止工作

下一篇: 红宝石考拉facebook graph geting公共活动