2008-12-05 16:42:38 -05:00
|
|
|
dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
|
|
require File.join(dir, 'httparty')
|
|
|
|
require 'pp'
|
|
|
|
|
2009-11-22 23:18:29 -05:00
|
|
|
# You can also use post, put, delete, head, options in the same fashion
|
2009-01-28 16:15:06 -05:00
|
|
|
response = HTTParty.get('http://twitter.com/statuses/public_timeline.json')
|
2009-04-23 11:28:36 -04:00
|
|
|
puts response.body, response.code, response.message, response.headers.inspect
|
2009-01-28 16:15:06 -05:00
|
|
|
|
|
|
|
response.each do |item|
|
|
|
|
puts item['user']['screen_name']
|
2009-04-23 11:28:36 -04:00
|
|
|
end
|