Facebook Application that Searches for nearest Place

时间秒杀一切 提交于 2019-12-05 02:42:58

问题


Is it possible to create a facebook application that would display a list of the nearest place of interest location?

Much like the current existing Urbanspoon Application (http://www.urbanspoon.com/c/338/Perth-restaurants.html) but on facebook.

Can somebody please point me to the right direction :)


回答1:


Get place ID for user's current location:
SELECT current_location FROM user WHERE uid=me()

Get coordinates for that place ID:
https://graph.facebook.com/106412259396611

Get nearby places:
https://graph.facebook.com/search?type=place&center=65.5833,22.15&distance=1000

You could of course get the latitude and longitude by other means.




回答2:


I know this is a resolved post, but i've also been doing some work on this and thought I'd add my findings / advice...

Using the FQL:

SELECT page_id, name, description, display_subtext FROM place WHERE distance(latitude, longitude, "52.3", "-1.53333") < 10000 AND checkin_count > 50 AND CONTAINS("coffee") order by checkin_count DESC LIMIT 100

This will get pages containing the word "coffee" in their title, description or meta-data that are within 10k of the specified lat/lon.

  "page_id": 163313220350407, 
  "name": "Starbucks At Warwick Services, M40", 
  "display_subtext": "Coffee Shop・Service Station Supply・3,012 were here"

I like to set a min check-in count of around 50 to help filter out the ad-hoc places that single users create such as "the coffee machine at jim's house". This helps ensure better quality and relevancy of returned results.

Hope this helps someone.



来源:https://stackoverflow.com/questions/9579739/facebook-application-that-searches-for-nearest-place

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