我已经能够使用检索事件详细信息
@graph = Koala::Facebook::API.new(access_token)
@eventSummary = @graph.get_object(eventId)
并使用邀请的用户列表
@eventSummary = @graph.get_connections(eventId, "invited")
我想统计所有被邀请的用户,也许是被拒绝和接受的用户。我正在使用的
@eventSummary = @graph.get_connections(eventId, "invited?summary=1")
这再次只给了我用户列表。当使用graph.facebook之类的
https://graph.facebook.com/***eventId***/invited?access_token=*****access_token****&summary=1
我正在计算结果。
{
“数据”: [
{
“名称”:“xyz”,
"rsvp_status": "出席",
“id”:“10000000123”
}
],
“分页”:{
“下一个”:“https://graph.facebook.com/***eventId***/invited?summary=1&access_token=***accesstoken***&limit=5000&offset=5000&__after_id=100004389574321”
},
“概括”: {
“noreply_count”:0,
“也许计数”:0,
“declined_count”:0,
“参加人数”:1,
“计数”:1
}
}
为了解决问题,我使用 fql 得到结果,如:
@eventSummary = @graph.get_object("fql", :q => "SELECT all_members_count, attending_count, declined_count, not_replied_count, unsure_count FROM event WHERE eid = #{eventId}")
但这不方便使用。谁能帮忙,我做错了什么?获取事件 RSVP 计数。我正在使用 Rails v.3.2,用于使用 Koala gem 的 facebook。提前致谢。