Facebook Graph API Get All Events For Latitude and Longitude

霸气de小男生 提交于 2019-12-18 07:25:12

问题


I'm trying to get All public events for given location. Here is what I'm using now

SELECT+name,+pic_cover,start_time,+end_time,+location,+description,venue++FROM+event+WHERE+eid++in(SELECT+eid+FROM+event_member+WHERE+uid+IN+(SELECT+page_id+FROM+place+WHERE+distance(latitude,+longitude,+"40.1811",+"44.5136")+<+50000+limit+0,15000))+ORDER+BY+start_time+desc+limit+0,1500

But there are huge count of events with that location which didn't returning with that FQL query. Is there any chance to get all events for given location or it may be by City ?
I'm using Python , but if you have some example code on any language please write it out.


回答1:


I think if you omit the subquery for the event_member table, you'll eventually get more results. Please consider that the results will only include Events created by the Page itself, not those created by individual users.

SELECT name, pic_cover,start_time, end_time, location, description,venue FROM event WHERE creator IN (SELECT page_id FROM place WHERE distance(latitude, longitude, "40.1811", "44.5136") < 50000 limit 0,15000) and start_time > now() ORDER BY start_time desc limit 0,1500 

If you have a list of venues of interest, you could use the method I described here: Facebook FQL find all events that take place at a certain venue

Edit 2017-12-20:

As it is now impossible to use FQL if the app was created after 2014-04-30, a direct search is no longer possible. To achieve that, a three-step approach must be used, as implemented in https://github.com/tobilg/facebook-events-by-location-core for example.



来源:https://stackoverflow.com/questions/22616846/facebook-graph-api-get-all-events-for-latitude-and-longitude

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