Created
April 11, 2013 02:22
-
-
Save stephen-puiszis/5360155 to your computer and use it in GitHub Desktop.
Facebook API Demo
This file contains 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 'open-uri' | |
require 'json' | |
your_access_token = "put your access token from the Graph API Explorer here" | |
url = "https://graph.facebook.com/me/home?fields=from,picture,link,source,name,description,type&access_token=#{your_access_token}" | |
result = JSON.parse(open(url).read) | |
posts = result["data"] | |
posts.each do |p| | |
if #something -- how will you test if the post is sharing a video? | |
puts "#{p["from"]["name"]} said, '#{p["message"]}'" | |
# print the link to video, for good measure | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment