Getting Facebook Events using fql
Trying to retrieve facebook events through fql using the query below. I am unable to get venue details other than "id".
fql?q=SELECT name,description, pic_small,pic_big, eid,venue,location from event WHERE eid in (SELECT eid FROM event_member WHERE uid = me())
output :
{
"data": [
{
"name": "HappyHour",
"description": "Let's have fun !!!",
"pic_small": "http://profile.ak.fbcdn.net/static-ak/rsrc.php/v2/yy/r/XcB-JGXohjk.png",
"pic_big": "http://profile.ak.fbcdn.net/static-ak/rsrc.php/v2/yn/r/5uwzdFmIMKQ.png",
"eid": ......,
"venue": {
"id": .......
},
"location": "The Crab Pot Seattle"
}
]
}
The graph api doc says "The venue where the event being queried is being held. Contains one or more of the following fields: street, city, state, zip, country, latitude, and longitude." but I don't see any of these except venue id.
Do I have to make another request to graph API to get the venue location details? Is there a better way to get the location details in one query itself?
You can get the locations for events using this FQL Multiquery.
This will get your events and information about their venues. You'll have to write a script on your end to combine them into something usable.
fql?q={
"event_info":
"SELECT name,description, pic_small,pic_big, eid,venue,location
FROM event WHERE eid IN
(SELECT eid FROM event_member WHERE uid = me())",
"event_venue":
"SELECT name, username, page_id, location
FROM page WHERE page_id IN
(SELECT venue.id FROM #event_info)"
}
Facebook changed the default encoding for events sometime in April. It used to be that all location data always used to be returned. Since then only the id
of the location has been returned.
上一篇: 通过Facebook查询语言(FQL)查询Facebook的URL
下一篇: 使用fql获取Facebook事件