Created
April 10, 2009 22:36
-
-
Save larrywright/93344 to your computer and use it in GitHub Desktop.
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
#from: http://github.com/jnunemaker/httparty/examples/basic | |
dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib')) | |
require File.join(dir, 'httparty') | |
require 'pp' | |
# You can also use post, put, delete in the same fashion | |
response = HTTParty.get('http://twitter.com/statuses/public_timeline.json') | |
puts response.body, response.code, response.headers.inspect | |
response.each do |item| | |
puts item['user']['screen_name'] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment