Reputation: 1444
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.
Upvotes: 1
Views: 2083
Reputation: 19990
expanding on sarfaz's answer:
use the following query for each of your friends:
SELECT name FROM event WHERE eid IN (SELECT eid from event_member WHERE uid = $friend_uid )
that will return the exact list of events that friend is attending. then, parse that list of friends and gather the events they are attending in order to create a reversed map of the data.
from my experience this FQL query takes a long time to execute, especially if you are going to be running it multiple times for each of your friends. be weary of facebook timeouts if you are using an FBML app -- otherwise you might want to batch this call.
Upvotes: 1
Reputation: 10562
The api says events.get should help you. Pass in the uid of each of your friends and consolidate the event ids that come back.
edit: sarfraz may have the better answer here, one call to FQL is going to be more efficent.
Upvotes: 0
Reputation: 382706
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:
Upvotes: 2