Created
March 27, 2009 15:58
-
-
Save damon/86757 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
#!/usr/bin/env ruby | |
# To install: | |
# sudo gem sources -a http://gems.github.com # (if needed) | |
# sudo gem install hayesdavis-grackle | |
# see http://github.com/hayesdavis/grackle for more info | |
# To run: | |
# Set USER and PASS for the account you want to clean. | |
# ./whack_statuses.rb | |
require 'rubygems' | |
require 'grackle' | |
USER = "youruser" | |
PASS = "yourpass" | |
client = Grackle::Client.new(:username=>USER,:password=>PASS) | |
puts "Retrieving tweets..." | |
page,last_size = 1,0 | |
tweets = [] | |
while (tweets.size > last_size || page == 1) | |
last_size = tweets.size | |
tweets << (client.statuses.user_timeline.xml? :page => page) | |
page += 1 | |
tweets.flatten! | |
end | |
if tweets.size > 0 | |
puts "Requesting to destroy #{tweets.size} tweets. This will take around #{(tweets.size/60).ceil} minutes or less..." | |
else | |
puts "No tweets. Nothing to do." | |
end | |
tweets.each do |s| | |
puts "Destroying tweet ##{s.id} with the content #{s.text}!" | |
puts '.' | |
client.statuses.destroy! :id => s.id | |
puts '..' | |
sleep 1 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment