i want to get from facebook the events that my friends are going to them. for example
- eventId1 (friend1,friend2,friend3)
- eventId2 (friend10,friend55);
and so on...
how can i accomplish it ?
thank for replays.
i want to get from facebook the events that my friends are going to them. for example
and so on...
how can i accomplish it ?
thank for replays.
One way do get events is using the FQL. Here is how you can get all the events your friends are going to attend:
SELECT name FROM event WHERE eid IN (SELECT eid from event_member WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=''$user_id'') )
More here:
扩展 sarfaz 的回答:
对您的每个朋友使用以下查询:
SELECT name FROM event WHERE eid IN (SELECT eid from event_member WHERE uid = $friend_uid )
这将返回朋友正在参加的活动的确切列表。然后,解析该朋友列表并收集他们正在参加的活动,以创建数据的反向映射。
根据我的经验,这个 FQL 查询需要很长时间才能执行,特别是如果您要为每个朋友多次运行它。如果您使用的是 FBML 应用程序,请不要担心 facebook 超时 - 否则您可能需要批处理此调用。
api说events.get应该可以帮助你。传入每个朋友的 uid 并合并返回的事件 id。
编辑:sarfraz 在这里可能有更好的答案,拨打 FQL 会更有效。