Luiz E. Luiz E. - 7 months ago 27
Ruby Question

how to search for pages with koala

I'm trying to using Koala gem to search for facebook page, like this

@graph.get_connection('search', movie_name)


but I got this
/Users/luizeduardo/.rbenv/versions/2.2.3/lib/ruby/2.2.0/uri/generic.rb:1100:in rescue in merge': bad URI(is not URI?): /search/Jurassic World (URI::InvalidURIError)


Seems like I'm using the wrong method OR this is not possible

Answer

Have a look at

You can also search for users/pages/events/groups for the keyword of your choice:

# http://graph.facebook.com/search?q=koala&type=place
@graph.get_connection('search', type: :place)
# => [{"category"=>"Attractions/things to do", ...
#     "name"=>"Maru Koala & Animal Park"}]}

In your case this would mean

@graph.get_connection('search', type: :page)

IMHO...

See