Getting Facebook Events using fql

蹲街弑〆低调 提交于 2019-11-29 23:52:50

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/10902259/getting-facebook-events-using-fql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!