Created
May 7, 2009 09:40
-
-
Save aitor/108030 to your computer and use it in GitHub Desktop.
This file contains 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' | |
# 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