The Tumblr Gem
Last night, I released the Tumblr gem, a command line utility and Ruby library for interacting with Tumblr. Here’s what it does:
$ tumblr my_post.txt
That will publish
my_post.txt to Tumblr. Simple.
You can also give it a URL:
That will create a Link post on Tumblr pointing to the
Or create a Video post by giving it a YouTube or Vimeo URL:
Easy publishing to Tumblr on the command line.
You need Ruby and Rubygems installed:
$ gem install tumblr-rb
tumblr(1) to get an idea of what you can do.
How it works
tumblr does a pretty good job of inferring what kind of post you want to make, as shown above, but you can add more options to your document by adding a little bit of YAML frontmatter, in the style of Jekyll. You can do things like specify a post-type, tagging posts, saving posts to your queue, etc. Read more about post formatting in
Most of my Tumblr posts begin life as little notes in Notational Velocity (combined with Simplenote). I write them in Markdown, and then copy and paste them into Tumblr.com. It feels tedious. Now, with
tumblr, I write a post in TextMate and can publish it immediately, with very little effort.
This post began life as a gist, and was published via the command line with
The Tumblr gem was created as a kind-of-sort-of proof-of-concept for Weary, a Ruby library I wrote for simple RESTful web service consumption. Tumblr (the gem), is a robust Ruby wrapper supporting full coverage of the Tumblr API. The
tumblr command line tool is a client of the Tumblr Ruby library (and comes packaged with it). I published this post with
tumblr. In software, this is called "eating your own dogfood".
The Tumblr Gem (my more-or-less official name for it; I also sometimes refer to it as “
tumblr-rb”), is Open Source, available under an MIT License. The source code is available on GitHub.