Tim's Daft Junk

Post to Tumblr from Textmate

I am a big fan of TextMate and use it as a general text editor, for Ruby development, and whatever else I can shove into its interface. And that now includes blogging. Surely there are many ways to achieve the nirvana of posting to Tumblr from TextMate but I did not find one readily available with a quick Google search, so decided to set out and come up with my own solution. It was remarkably simple.

First off, I downloaded the tumblr-rb gem created by Mark Wunsch. That installs a tumblr executable to your path:

gem install tumblr-rb

Then I created a dotfile that contains my tumblr credentials and placed it in my home directory:

$ cat ~/.tumblrlogin
email: notmyreal@address
password: mysecretpassword

With that setup, you can pass a file or a URL to the tumblr command to post to tumblr, or you can even shove data to it from STDIN. It’s flexible like that.

The cool thing is that you can author your blog post in Markdown and include some front-loaded YAML to set up things such as a title, tags, slugs, and so on.

With that in mind, I fired up ye olde Bundles -> Bundle Editor -> Edit Commands and chose the Markdown bundle and added a new command that looks like this:

Bundle Editor Window

So it looks like this:

Command: tumblr --credentials ~/.tumblrlogin
Input: Entire Document
Output: Create New Document
Activation: Key Equivalent (Whatever keystroke you want)

Now, I can open a new Markdown document, edit it, and hit my keystroke to have it automatically post to Tumblr! How cool is that? Here’s a very meta example of what my Markdown document looks like:

Markdown post for Tumblr

Now go have fun posting to Tumblr from TextMate!


  1. tnypxl reblogged this from timgourley
  2. matsuda reblogged this from timgourley
  3. fabbrikk reblogged this from timgourley
  4. razorsharp reblogged this from timgourley and added:
    Good stuff. This might become...new workflow. There’s nice benefits
  5. timgourley posted this
blog comments powered by Disqus
To Tumblr, Love Metalab