Skip to content

Instantly share code, notes, and snippets.

@wheresalice
Created April 17, 2010 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wheresalice/369822 to your computer and use it in GitHub Desktop.
Save wheresalice/369822 to your computer and use it in GitHub Desktop.
Mass delete Tumblr posts
# http://lds.li/post/232870067/bulk-deleting-tumblr-posts
require 'rubygems'
require 'open-uri'
require 'mechanize'
require 'pp'
site_dashboard_url = 'http://www.tumblr.com/tumblelog/lstoll'
email = 'lstoll@lstoll.net'
password = 'xxxxxx'
agent = WWW::Mechanize.new
agent.follow_meta_refresh = true
login = agent.get('http://www.tumblr.com/login')
page = login.form_with(:action => '/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 "about to submit..."
page = form.submit
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment