Skip to content

Instantly share code, notes, and snippets.

@gorsuch
Created November 9, 2009 22:23
Show Gist options
  • Save gorsuch/230344 to your computer and use it in GitHub Desktop.
Save gorsuch/230344 to your computer and use it in GitHub Desktop.
Delete's items from a given tumblr, 50 posts at a time
require 'rubygems'
require 'tumblr'
require 'hpricot'
config = {
:email => 'name@example.com',
:password => 'secret',
:name => 'your_tumblr_name'
}
tumblr = Tumblr.for config
xml = tumblr.read(:xml, :num => 50).content
doc = Hpricot(xml)
(doc/:post).each do |p|
tumblr.delete :xml, 'post-id' => p.attributes["id"]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment