Skip to content

Instantly share code, notes, and snippets.

@mourdok
Created April 3, 2010 01:36
Show Gist options
  • Save mourdok/353983 to your computer and use it in GitHub Desktop.
Save mourdok/353983 to your computer and use it in GitHub Desktop.
API Twitter eg.1
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