Skip to content

Instantly share code, notes, and snippets.

@eng
Created July 1, 2010 01:55
Show Gist options
  • Save eng/459450 to your computer and use it in GitHub Desktop.
Save eng/459450 to your computer and use it in GitHub Desktop.
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