Created
April 3, 2010 01:36
-
-
Save mourdok/353983 to your computer and use it in GitHub Desktop.
API Twitter eg.1
This file contains hidden or 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
require 'rubygems' | |
require 'twitter' | |
USERNAME, PASSWORD = '...', '...' | |
@http_auth = Twitter::HTTPAuth.new USERNAME, PASSWORD, :ssl => true | |
@client = Twitter::Base.new @http_auth | |
puts '----------------' | |
puts 'Friends timeline' | |
puts '----------------' | |
puts "\n" | |
@client.friends_timeline.each do |tweet| | |
puts "Screen name: #{tweet.user.screen_name} | Text: #{tweet.text}" | |
puts "Created at: #{tweet.created_at[0..9]} | Source: #{tweet.source}" | |
puts "\n" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment