Instagram Liquid Tag Plugin for Jekyll and Octopress

Being new to the world of Ruby (and obviously Jekyll), I thought a good initial learning experience would be to write a liquid tag for Jekyll to display an Instagram photo. I finished up a decent enough version of the code, and it's actually in use over at lukelov.es to display all my Instagrams. Check out this page for a complete example of what the finished product looks like.

It is a simple liquid tag which takes one parameter, the ID of a media item from Instagram. The code then fetches the media item using Instagram's ruby gem, and writes a bunch of relevant HTML to the page.

I currently have it displaying:

Obviously, the location information is only displayed if the Instagram has that data associated with it.

The embedded gist below should be the same as the code being used in the lukelov.es repository.

If you have questions, comments, bugs, etc, please leave a comment on this post or the gist, and if you'd like to contribute fixes or features directly, you can submit a pull request for this file.

400: Invalid request

On a side note, I also came up with a solution for how to batch create Instagram posts (as you might've noticed by the hundreds of Instagram posts on lukelov.es). The solution was to create a few Rake tasks similar to the ones that are already being used by Octopress to create new posts and pages. I will be writing another blog post soon detailing those and how they work, but if you would like a sneak peak, checkout the Rakefile for lukelov.es.