1
0
Fork 0
mirror of https://github.com/jnunemaker/httparty synced 2023-03-27 23:23:07 -04:00
httparty/examples/twitter.rb
2008-07-27 16:35:31 -04:00

17 lines
No EOL
412 B
Ruby

dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
require File.join(dir, 'web')
require 'pp'
config = YAML::load(File.read(File.join(ENV['HOME'], '.twitter')))
class Twitter
include Web
base_uri 'twitter.com'
format :xml
entity :status
entity :user
end
Twitter.basic_auth config['email'], config['password']
pp Twitter.get('/statuses/user_timeline.xml', :entity => :status)