-
-
Save hitode909/470855 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!ruby | |
require 'rubygems' | |
require 'twitter' | |
require 'pit' | |
def enjoy(&block) | |
begin | |
block.call | |
rescue => e | |
puts e.message | |
end | |
end | |
exit unless ARGV[0] | |
config = Pit.get('twitter', :require => { | |
'username' => 'username', | |
'password' => 'password', | |
}); | |
httpauth = Twitter::HTTPAuth.new(config['username'], config['password']) | |
client = Twitter::Base.new(httpauth) | |
30.times { | |
begin | |
puts 'post' | |
data = client.update(ARGV[0]) | |
puts data.id | |
rescue => e | |
puts e.message | |
enjoy { | |
client.user_timeline('hitode909').each{ |status| | |
if status.text == ARGV[0] | |
puts 'destroy old status' | |
client.status_destroy(status.id) | |
end | |
} | |
} | |
next | |
end | |
enjoy { | |
puts 'destroy' | |
client.status_destroy(data.id) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment