Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Script to bulk upload files to tumblr queue
#!/usr/bin/env ruby
# gem install tumblr_client
# use 'tumblr' command to generate security credentials
# fill in security info from the generated file at ~/.tumblr
# fill in the source directory and destintion directory
# fill in blogname
# script will upload a file then move it to the destination directory
require 'rubygems'
require 'tumblr_client'
Tumblr.configure do |config|
config.consumer_key = ""
config.consumer_secret = ""
config.oauth_token = ""
config.oauth_token_secret = ""
files = Dir["/home/username/tumblr_images/*"]
final_dir = "/home/username/queued_tumblr_images/"
blog = ''
# end variable section
client =
files.each do |file|
puts file
response =, {:data => [file], :state => 'queue' })
if response.has_key?("errors")
puts response
exit 1
File.rename(file, final_dir + File.basename(file))

This comment has been minimized.

Copy link

@topten10 topten10 commented Dec 30, 2016

Thank you for the script. I'm completely novice to scripts and coding so I am about to ask a dumb question. I really need a way to bulk upload posts to tumblr (non-images) and was hoping to use your script. How do I do that? What do I do with the the script/downloaded file? Again, I don't know much abut coding beyond html, css and these kind of things. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.