0

Using a Rails app with koala, how can I get a list of restaurants and places within a city?

For reference:

graph = Koala::Facebook::API.new(@current_user.oauth_token)
graph.get_object("me")["location"]["name"]

gets me the user's city.

Crablar
  • 1
  • 2

2 Answers2

0

To use Graph API Search with Koala Gem create an object and use .graph-call method and pass in the api call you would make as a single string parameter like so:

fb = Koala::Facebook::API.new(ENV['FACEBOOK_CLIENT_TOKEN'])
lookup = fb.graph_call("search?q=coffee&type=place&center=37.76,-122.427&distance=1000")
lacostenycoder
  • 10,623
  • 4
  • 31
  • 48
-1

I don't know the specifics of the Koala framework, but Graph API-wise you can use the search endpoint es described at https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#search

Sample query:

GET graph.facebook.com/search?
    q=coffee&
    type=place&
    center=37.76,-122.427&
    distance=1000

Also have a look at

Tobi
  • 31,405
  • 8
  • 58
  • 90