Skip to content

Instantly share code, notes, and snippets.

@marshluca
Created April 29, 2010 01:29
Show Gist options
  • Save marshluca/382999 to your computer and use it in GitHub Desktop.
Save marshluca/382999 to your computer and use it in GitHub Desktop.
twitter timeline
# usr/bin/ruby
# encoding: UTF-8
require 'rubygems'
require 'open-uri'
require 'json'
#cmd = 'curl --basic --user username:password http://twitter.com/statuses/friends_timeline.json'
url = 'http://twitk.com/k/statuses/friends_timeline.json'
buffer = open(url, :http_basic_authentication => ["username", "password"]).read
result = JSON.parse(buffer)
result.each do |tweet|
puts tweet['user']['name'] + ': ' + tweet['text']
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment