-
-
Save dnpp73/1127171 to your computer and use it in GitHub Desktop.
favorit爆撃を与えてターゲットのデスクトップをGrowlで埋めるなどします
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
#coding: utf-8 | |
require 'twitter' | |
Twitter.configure do |config| | |
config.consumer_key = YOUR_CONSUMER_KEY | |
config.consumer_secret = YOUR_CONSUMER_SECRET | |
config.oauth_token = YOUR_OAUTH_TOKEN | |
config.oauth_token_secret = YOUR_OAUTH_TOKEN_SECRET | |
end | |
client = Twitter::Client.new | |
print "screen_name: " | |
target = gets.chomp | |
print "爆撃数(MAX200): " | |
count = gets.chomp | |
tweets = client.user_timeline(target,:count=>count) | |
tweets.each_with_index do |tweet,index| | |
puts "#{index + 1}: #{tweet.text}" | |
Thread.new do | |
begin | |
client.favorite_create(tweet.id) | |
puts "done!" | |
rescue => e | |
puts e | |
end | |
end | |
end | |
Thread::list.each {|t| t.join if t != Thread::current} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment