Facebook Event Widget
Given the Facebook event ID, I want to display a list of the current user's friends who are attending said event.
Seems like it should be under the auspices of a Social Plugin, but can开发者_运维知识库't seem to find the correct juice.
Using FQL, I believe the query should look something like:
SELECT uid, eid, rsvp_status FROM event_member WHERE eid=EVENTID AND uid IN (SELECT uid2 FROM friend WHERE uid1=USERID)
EDIT:
Based on your comment below, assuming that you have the JavaScript SDK setup already (if you don't go here: http://developers.facebook.com/docs/reference/javascript/ for more info), the code below should do what you need (just write out the results with jQuery in the callback). All you need to do is plugin the EVENTID to the query:
FB.api(
{
method: 'fql.query',
query: 'SELECT uid, eid, rsvp_status FROM event_member WHERE eid=EVENTID AND uid IN (SELECT uid2 FROM friend WHERE uid1=me())'
},
function(response) {
// Process response with jQuery
}
);
I've found a great tutorial:Facebook Programming: API Events
I've posted is as answer to How to share facebook events by my website? which states another problem, how to add 'Join Event' button to the page, which unfortunatelly is by the moment unanswered...
精彩评论