Skip to content

Instantly share code, notes, and snippets.

@cheald
Created November 1, 2012 23:28
Show Gist options
  • Save cheald/3997497 to your computer and use it in GitHub Desktop.
Save cheald/3997497 to your computer and use it in GitHub Desktop.
require 'faraday'
require 'json'
url = "http://api.twitter.com/1/statuses/user_timeline.json?id=cheald"
response = Faraday.get url
if response.success?
result = JSON.parse(response.body)
puts "Tweets: %s\n" % result.map {|tweet| tweet["text"] }.join("\n")
else
puts "An error occurred and we couldn't get your tweets"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment