Skip to content

Instantly share code, notes, and snippets.

@aitor
Created May 7, 2009 09:40
Show Gist options
  • Save aitor/108030 to your computer and use it in GitHub Desktop.
Save aitor/108030 to your computer and use it in GitHub Desktop.
require 'rubygems'
# the "jnunemaker-twitter" gem
require 'twitter'
#client = get_auth_client
# todo Store the last tweet
since_tw = 0
results = Twitter::Search.new("#euruko").per_page(100).since(since_tw)
results.each do |tweet|
rt = "RT #{tweet.text} (via @#{tweet.from_user})"
puts rt
#client.update(rt)
end
def get_auth_client
config = YAML::load("#{ENV['HOME']}/.twitter")
oauth = Twitter::OAuth.new(config['token'], config['secret'])
oauth.authorize_from_access(config['atoken'], config['asecret'])
Twitter::Base.new(oauth)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment