How to delete your Tumblr tumblelog with TumblrCleanr
Tumblr is rapidly becoming my favorite free blogging platform (more so than Blogger/WordPress.com) because of all the things they do correct:
- RSS feed importing (up to 5)
- free domain name support
- free CSS/theme support
- Google Analytics support
- javascript widget support
- keeping it simple
(You can read more about Tumblr’s Pro and Cons in this post I wrote for Lorelle on WordPress)
However, there’s one feature that’s missing: how do you delete your Tumblr? At some point you might want to destroy all traces of your tumblr (privacy concerns, or you want to use it for something else) and there isn’t an option to do that — other than click the delete button on every individual post. I wanted to repurpose a tumblr I had been using for feed aggregation and it had over 18,000 posts. That’s a lot of clicks.
Enter the TumblrCleanr. Provide it with your tumblr domain name as well as your username and password and it will delete up to the latest 3000 posts at a time. You can keep running it until your entire tumblr is clean as a whistle.
This script will DELETE ALL POSTS ON YOUR TUMBLR WITH NO BACKUPS. If that isn’t what you want to do then please don’t use it. :)
Privacy Concerns
TumblrCleanr does not store your login information anywhere. It only uses it to communicate with tumblr.com. Every time you run the program you will have to re-enter your login details.
But Why Not Create a New Tumblr?
That’s true. It’s much easier to create a new tumblr account with a different email address than it is to “reset” your existing Tumblr. You can even just change the tumblr domain name if you want to “free up” your good domain for something else. I created TumblrCleanr as an excuse to try InnoSetup, WWW::Mechanize, rdoc, rake and rubyscript2exe for the first time and to give myself some more experience coding in Ruby.
How to Install
Windows users can use the one-click installer (2.2 MB). Download it, run it and TumblrCleanr will show up in your start menu.
Linux/Mac OSX users with ruby installed can use the Ruby gem (6 kb). From a console window type the following:
wget http://internet-duct-tape.googlecode.com/files/tumblr_cleanr-0.0.1.gem sudo gem install tumblr_cleanr-0.0.1.gem
The Source Code
Here’s the Ruby source code (to version 0.0.1). Leave a comment if you have any suggestions on improving it.
#See TumblrCleanr class for full documentation require 'rubygems' # Note: not using Tumblr API because it does not support delete # http://ruby-tumblr.rubyforge.org/ require 'mechanize' # http://mechanize.rubyforge.org/mechanize require 'net/http' # http://www.ruby-doc.org/stdlib/libdoc/net/http/rdoc/classes/Net/HTTP.html require 'uri' require 'logger' #== TumblrCleanr - clean/reset your tumblr by deleting all posts #Author:: engtech (http://InternetDuctTape.com, http://rubeh.tumblr.com) #Copyright:: Copyright (c) 2008 engtech #License:: Creative Commons Attribution-Noncommercial 2.5 License #Id:: $Id: $ # #Tumblr is rapidly becoming my favorite hosted blogging platform (more so than Blogger/WordPress.com) because of all the things they do correct: # #- RSS feed importing #- free domain name support #- free CSS/theme support #- Google Analytics support #- keeping it simple # #However, there's one feature that's missing: <b>how do you delete your Tumblr?</b> At some point you might want to destroy all traces of your tumblr (privacy concerns, or you want to use it for something else) and there isn't an option to do that -- other than click the delete button on every individual post. I wanted to repurpose a tumblr I had been using for feed aggregation and it had over 18,000 posts. That's a lot of clicks. # #Enter the TumblrCleanr. Provide it with your tumblr domain name as well as your username and password and it will delete up to the latest 3000 posts at a time. You can keep running it until your entire tumblr is clean as a whistle. # #== Privacy Concerns # #TumblrCleanr does not store your login information anywhere and only uses it to communicate with tumblr.com. Every time you run the program you will have to re-enter your login details. # #== License # #This work is licensed under the Creative Commons #Attribution-Noncommercial 2.5 License. # #To view a copy of this license, visit # http://creativecommons.org/licenses/by-nc/2.5/ or #send a letter to # Creative Commons, 543 Howard Street, 5th Floor, # San Francisco, California, 94105, USA. # class TumblrCleanr # tumblr domain name is set by login method @domain # email address is set by login method @email # password is set by login method @password # WWW::Mechanize agent is created in login method @agent # Array of tumblr postids is set by post_archive method @postids #Initializing TumblrCleanr will start an interactive prompt asking your your tumblr domain name, email address and password. #domain name:: the domain name used to access your tumblr, without the http:// prefix (eg: popstar.tumblr.com) #email address:: the email address used to login to tumblr (eg: brittney.spears@gmail.com) #password:: the password for your tumblr account, <b>not the password for your email address</b> # #When the program finishes the user is prompted to press enter to quit. # def initialize begin puts "Welcome to TumblrCleanr by http://InternetDuctTape.com" query_loop parse_archive clean print "Success" rescue Interrupt => e puts "User pressed Ctrl-C" rescue Exception => e puts "#{e.class}: #{e.message}" puts e.backtrace.join("n") end puts "Press enter to exit..." gets end private #Keeps asking the user for their login information until they enter something that works. #Press Ctrl-C to exit the loop (and the program). # def query_loop login_success = false while not login_success do begin query_user login login_success = true rescue Interrupt => e raise Interrupt, "user abort" rescue Exception => e puts "#{e.class}: #{e.message}" puts e.backtrace.join("n") login_success = false puts "" puts "Unable to login with #{@email}/#{@password} on #{@domain}" puts "Type 'Ctrl-C' to abort" end end end #Asks the user for @domain, @email, and @password # #Side Effect:: sets @domain, @email and @password # def query_user puts "" puts "Tumblr domain (ie: popstar.tumblr.com): " @domain = gets.chomp puts "Tumblr email address (ie: brittney.spears@gmail.com): " @email = gets.chomp puts "Tumblr password (ie: kfedsux): " @password = gets.chomp end #Creates a WWW::Mechanize @agent and uses it to verify that @domain is correct and #that the @email/@password combination logs in. # #Side Effect:: creates @agent # def login puts "Trying to connect to tumblr" @agent = WWW::Mechanize.new do |a| # a.log = Logger.new("mech.log") # a.log.level = Logger::DEBUG a.redirect_ok = true a.user_agent_alias = 'Windows Mozilla' end # Is the domain any good? This will raise 404 error if bad. @agent.get("http://#{@domain}") # Can the user login? page = @agent.get('http://www.tumblr.com/login') login_form = page.forms.first login_form.email = @email login_form.password = @password result = login_form.submit(login_form.buttons.first) raise "Bad username or password" unless "Logging in..." == result.title end #The Tumblr API does not provide a bandwidth efficient means of getting a list of all postids #without getting the entire posts as well. #This is a bad hack to use the /archive page to get a list of 3000 post_ids at a time. #It uses Net::HTTP because the post_ids which are stored as javascript, so Mechanize can't access them. #ie: location.href='http://rubeh.tumblr.com/post/22655521 # #Side Effect:: sets up @postids as an array of postids (as strings) # def parse_archive url = URI.parse("http://#{@domain}/archive") req = Net::HTTP::Get.new(url.path) res = Net::HTTP.start(url.host, url.port) {|http| http.request(req) } # with the body of the archive page, split it into chunks that have one postid each. # use a regular expression to extract the postid @postids = res.body.split("onclick").map{|chunk| (chunk =~ /location.href='http://[^/]+/post/(d+)/) ? $1 : nil }.reject{|i| nil == i} end # Using the list of @postids from parse_archive, iterate through them and send HTTP POSTs to the /delete/id action. # It does not check that the delete occurs. As a matter of fact, it intentionally asks to redirect to a 404 to reduce # bandwidth. # def clean total_ids = @postids.size @postids.each_with_index do |postid, i| puts "nDeleted #{i}/#{total_ids}" if i % 25 == 0 print "." result = @agent.post("http://www.tumblr.com/delete", 'id' => postid, 'redirect_to' => '/404') rescue nil # usually tumblr redirects to the dashboard after a delete happens # I'm intentially creating a 404 because it's much less bandwidth intensive end puts end end TumblrCleanr.new
I vote for a name change! Something like Detumblr the tumblr eraser. Tumblrcleanr sounds like some sort of maintenance app that checks links, comments and washes your delicates by hand.
Well, it kind of washes your delicates by acid.
I found a hosted website that should do the same thing:
http://cxzcxz.com/dev/tumblatr/
tumblatr ftw
Ha, who knew the world of erasing a Tumblr account was so competitive? I had to create Tumblatr to vent a lot of frustration I was feeling one night regarding the lack of a mass-delete option. It uses PHP/cURL and some DOM parsing to do the job, but it’s all a bit hacky since I stopped working on it once I got it to erase my account. Tumblatr should do the job, but your version looks much more sexily written. I can tell by some of the source and from seeing some sexy code in my time.
Engtech, he’s bring sexy (code) back!
[…] How to delete your Tumblr tumblelog with TumblrCleanr […]
Awesome. I wrote Tumblr support asking to have my Tumblr cleared out, and about four months later they wrote back and said “no”. No customer service == scripted solutions. Good work!
I love Twitter and Tumblr. I also tried out Pownce recently but I am not a big fan of the templates. They are just way too over crowded for me.
I post non-stop at chvnx.com since I switched to Tumblr. It’s so easy to use and it serves my needs perfectly. I don’t have a niche and posting random junk using Tumblr works so smoothly.
Although Twitter and Pownce are similar (both are social presence sites) I find that Tumblr is different all together. It offers so much more all while seeming so much simpler. I recently read on some random blog that Tumblr was probably going to receive the same ammount of attention in 2008 that Twitter got in 2007.
Only time will tell!
chvnx.com
engtech’s recommendation was way better.
but either way if you choose to have your own ruby thing running to delete stuff or use http://cxzcxz.com/dev/tumblatr/… even though the tumblelog wont contain any posts after deletion, the feed for that tumblelog will still show old posts.
i know from experience, even if you delete a post from dashboard, once published, the post stays on rss.
http://www.tumblr.com/account/delete
Thanks for this. You can now delete your tumblr, did you know that?
I just made a new Tumblr theme and its available for download @ SkyLite.Tumblr.com.
Come check it out and feel free to follow my tumble log @ chvnx.com
This didn’t work for me. It said success but nothing was deleted. Any ideas?
Hello there,
Your code still works or Tumblr has undergone some recent updates so it stopped working?
I’m not sure but it’s not working for me even after getting the success message.
Would you mind to take a look if everything is working fine for you?
Thanks for sharing TumblrCleanr. I’ve a Tumblr where I was feeding things in … but want to delete most entries to use it as a clippings blog.
I’ve installed TumblrCleanr on XP, and it starts okay. I’m getting a “Unable to login with / on .tumbler.com ” message.
The last successful report of using TumblrCleanr seems to be a year ago, so I assume that something has changed in Tumblr, and this script hasn’t been updated. Please let me know if I’m mistaken. Thanks.
Not that I’m totally impressed, but this is a lot more than I expected for when I stumpled upon a link on Digg telling that the info is awesome. Thanks.
[…] suggest trying engtech’s solution, or if you just want to delete your account, Tumblr has now made that option […]
I entered this (wget http://internet-duct-tape.googlecode.com/files/tumblr_cleanr-0.0.1.gem
sudo gem install tumblr_cleanr-0.0.1.gem) into my terminal window (on an OSX) and it gives me this: http://i25.tinypic.com/ay3hps.png
Help, anyone?
(I just realised most of these comments are from 2008…)
hm, tumblr is way better than blogspot. i think blogspot is boring and has ugly layouts.
tumblr is way easier to use and has better layouts. you can choose from themes to the appearance look. and it has a lot of choices to choose from blogging and you can personalize it =) fuck blogspot!
Then there was a hard time in my life, I had an accident. ,
I really like when people are expressing their opinion and thought. So I like the way you are writing
doesn’t work : (
The windows version doesn’t work. I’m running Vista. :(
Doesn’t work with XP either.
Doesn’t work with Windows 7…
:/
It does not appear to be working anymore.
Are you working on another, do you know of any other resources?
I’m not familiar with running the ruby in command prompt :(