Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does facebook graph api provide support for searching Post messages by location?

Does facebook graph api provide support for searching Post messages by specific location?

like image 820
diya Avatar asked Nov 02 '11 04:11

diya


People also ask

What data can I get from Facebook graph API?

The Graph API is the primary way to get data into and out of the Facebook platform. It's an HTTP-based API that apps can use to programmatically query data, post new stories, manage ads, upload photos, and perform a wide variety of other tasks.

What information does Facebook API provide?

What is the Facebook API? The Facebook Graph API is an HTTP-based API that allows developers to extract data and functionality from the Facebook platform. Applications can use this API to programmatically query data, post in pages and groups, and manage ads, among other tasks.

Which API does Facebook provide for apps to read and write to the social media graph?

The Graph API is the primary way for apps to read and write to the Facebook social graph.

How do you use graph search on Facebook?

Sign in to your Facebook account using either your username or your registered email address and password. Activate Graph Search. If you have never used Graph Search before, activate this feature using this link: www.facebook.com/about/graphsearch. Once the page opens up, click on the "Try Graph Search" link.


2 Answers

It's going to be a multi-step process.

  1. Find the places within your criteria. https://graph.facebook.com/search?q=coffee&type=place&center=37.76,-122.427&distance=1000&fields=id
  2. Loop thru each of those ids, and build yourself a multi FQL query with up to 50 queries (50 max is all facebook allows) fql?q=SELECT post_id, message, attachment FROM stream WHERE source_id = {pageId}
  3. Query results, and add to your list of posts
  4. repeat 2-3 with the remaining ids returned from the search.
  5. display list of posts.
like image 93
DMCS Avatar answered Oct 03 '22 21:10

DMCS


You can now directly search for posts, photos near a location: https://developers.facebook.com/docs/reference/api/#searching

It was announced yesterday: http://developers.facebook.com/blog/post/2012/03/07/building-better-stories-with-location-and-friends/

An example from the docs: https://graph.facebook.com/search?type=location&center=37.76,-122.427&distance=1000&access_token=whatever

like image 31
thom_nic Avatar answered Oct 03 '22 22:10

thom_nic