My Digital Junk Drawer

It seems that when I want to create blog posts locally, I am left with a lot of overhead in terms of copying the file’s contents into the online editor, adding formatting or removing formatting, depending on the editor used to create the post and I find myself in a position where I am so caught up in the cumbersome process that I end up writing less than I should.

I’ve known about MarkDown for years and for a while I was pretty comfortable with it because I was using an open source wiki platform to keep notes in a private section of my website, but since then I didn’t really think to use it for anything. When writing in plain text, I have a habit of using my own personal markup for placeholders for links, notes on how to apply formatting later, etc. and that markup is very similar to MarkDown, so switching over would keep my writing style pretty much the same and it would then handle the formatting for me. So when I settled on Tumblr as my blogging platform, I started to brush up on MarkDown and immediately wanted to take it a step further and add automation to avoid the copy/paste/format/preview/repeat process I had been using. I want to work in a tool I’m comfortable with, be able to write without much thought on the process and have the ability to write when offline or in the rare cases when Tumblr is unavailable.

Since switching to a mac back in August, TextMate has come out on top as my editor of choice for pretty much any text based file. So I set out to figure out a way to work in TextMate, take advantage of TextMate’s extensibility through bundles and make the process of sending my finished posts directly to Tumblr. TextMate has a markdown bundle available, so the writing in TextMate will streamline the writing portion. I then considered using an Automator script to take the MarkDown file, put it into an email using the filename as the subject and the text as the body, then send it to the address that allows me to post via email on Tumblr. I spent about 5 minutes playing with that and got impatient, so I went back to searching for another solution…

Luckily, I stumbled onto This Post before I wasted a ton of time with Automator. I quickly set to work installing the required Ruby script, creating a simple bundle in TextMate and began writing this post. This post is my test, so if you’re reading this, it worked!

My Attempts to make my life easier came with some challenges

So Far, the attempts to publish this via the Bundle have not been working. I have uninstalled the tumblr-rb gem and installed some others that were mentioned here. I just re-installed the tumblr-rb gem and am going to make another attempt… and it failed. I continue to get the following error:

undefined method 'blank?' for [:title, :body]:Array (NoMethodError)

Based on the comments in the Github error referenced above (as of 12/4/11), it doesn’t look like there is a fix for this yet, but there was mention of the fact that versions above 0.2.0 of the crack gem are the reason people are receiving this error, so I installed the older version by running:

sudo gem install crack -v 0.2.0

And making another attempt at publishing this post. Again, I was greeted with the same error message.

I then decided to remove the newer version of the crack gem by running the following command and selecting the newer version when prompted:

sudo gem uninstall crack

I don’t do much with ruby, so I’m hoping this doesn’t break anything else… if it does, I’ll simply reinstall it.

This time, I was greeted with the following error message:

Error: An email address and password are required. Use 'tumblr -a' to authenticate. See 'tumblr --help' for details.

This is good news. It means I have avoided the error in the tumblr-rb gem and just need to fix the way I am calling it in my Bundle. I updated the Post command in my bundle to include the -a parameter before the –credentials option. That yielded the same result. So I finally updated the command in my bundle to call the -a parameter and included my email and password instead of pointing to my credentials file.

It worked this time!

Blog comments powered by Disqus