1
0
Fork 0
mirror of https://github.com/jnunemaker/httparty synced 2023-03-27 23:23:07 -04:00
httparty/examples/basic.rb
2009-01-29 04:23:44 -05:00

11 lines
No EOL
376 B
Ruby

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