Skip to content

Instantly share code, notes, and snippets.

@cjohannsen81
Created March 22, 2014 07:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjohannsen81/9702773 to your computer and use it in GitHub Desktop.
Save cjohannsen81/9702773 to your computer and use it in GitHub Desktop.
Get Facebook message based on location using koala in ruby
require 'koala'
APP_ID = ""
APP_SECRET = ""
access_token = ""
oauth = Koala::Facebook::OAuth.new(APP_ID, APP_SECRET)
oauth.exchange_access_token_info(access_token)
@graph = Koala::Facebook::API.new(access_token)
profile = @graph.get_object("me")
friends = @graph.get_connections("me", "friends")
# Returns the feed items for the currently logged-in user as a GraphCollection
feed = @graph.get_connections("me", "feed")
feed.each {|f|
if f['place'] != nil
p f['place']
p f['message']
end
}
#put something in the timeline
#@graph.put_connections("me", "feed", :message => "I am writing on my wall using the koala gem and ruby!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment