#! /usr/bin/env ruby

# Norbert Wigbels
#
# remove all your tweets;
# basically, if you want to keep your account
#
# adapted from http://blog.johnwyles.com/articles/2009/01/06/destroying-deleting-and-erasing-old-twitter-tweets/

require 'rubygems'
require 'activesupport'
require 'twitter'


# auth yourself
httpauth = Twitter::HTTPAuth.new('YOUR_USERNAME', 'PASSWORD')
twitter = Twitter::Base.new(httpauth)

# go for complete deletion
chunk = twitter.user_timeline
while chunk do
  chunk.each do |s|
    twitter.status_destroy(s.id)
    puts "Deleted tweet: [#{s.id}] \"#{s.text}\" (#{s.created_at})"
  end
  chunk = twitter.user_timeline
end

# finally
twitter.update("Hey! Ho! Let's Go #rmallyourtweets http://foobla.wigbels.de/tag/delete-all-tweets/")
