Created
March 22, 2014 07:42
-
-
Save cjohannsen81/9702773 to your computer and use it in GitHub Desktop.
Get Facebook message based on location using koala in ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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