A convenient way to manage images for a blog is to host them on Flickr.

Using the Flickr API, it’s possible to do lots of useful things: use Flickr to serve thumbnails, fetch the metadata associated with the image, organise your galleries by tags then show them on your blog, …

Here is a very simple example.

The flickraw gem

Flickraw is a very convenient gem for accessing the flickr API, making it super-easy.

Add it to your gemfile:

(And don’t forget to run bundle install)

The FlickrImage plugin

Note: you have to define “FLICKR_KEY” and “FLICKR_SECRET” as environment variables for this script to work.
(You can find your flickr key and secret in your Flickr interface, after having registered your app.)

Put this file in the ‘plugins’ directory:

Usage in a post

Done !