Created
July 1, 2010 01:55
-
-
Save eng/459450 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
require 'rubygems' | |
require 'open-uri' | |
require 'mechanize' | |
require 'pp' | |
site_dashboard_url = 'http://www.tumblr.com/dashboard' | |
email = 'YOUR EMAIL' | |
password = 'YOUR PASSWORD' | |
agent = Mechanize.new | |
agent.follow_meta_refresh = true | |
login = agent.get('http://www.tumblr.com/login') | |
page = login.form_with(:action => 'http://www.tumblr.com/login') do |f| | |
f.email = email | |
f.password = password | |
end.click_button | |
page = agent.get(site_dashboard_url) | |
while form = page.form_with(:action => '/delete') | |
puts "deleting post..." | |
page = form.submit | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment