Ruby Wrapper to Tumblr API
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Tumblr Blogging with Redis

A simple, blogging "platform" built on Tumblr and Redis.


Tumblr has a great interface for tagging, writing, and editing posts, but you shouldn't rely on it for being up all the time. You also shouldn't have to worry about Tumblr API integration or cacheing on your own. Tumblrb handles the Tumblr API integration, Redis cacheing, and fetching all with an easy to use interface.




gem install tumblrb

Or add

gem 'tumblrb', :require => "tumblr"

to your Gemfile


Tumblrb Needs a little configuration to work properly. It needs to know your blog, your Tumblr API key, and how to connect to a running Redis server :

You can do that using the configure method :

Tumblr.configure do |config| = "thegorgonlab"
  config.api_key = "YOUR API KEY"
  config.redis = {:host => "localhost", :port => 6379}

Redis configuration takes a string path to a configuration file, a hash of options, or a Redis instance itself. If you don't include a "." in your blog name it will add "" to the end of what you provide. For information about API keys see the Tumblr API documentation

Or if you like having all your configuration in a YAML file, you can put it all in a YAML file under the key tumblr and call :


Blog and Redis

Most interactions with the Tumblrb gem happen through the Blog class, which handles fetching from Tumblr and caching in Redis.

To get started, fetch the posts from Tumblr and cache them in Redis, call Blog.refresh!. Every time you write a new post for your Tumblr blog, call this method again to keep Tumblrb up to date.

Afterwards, to access your blog entries use an AREL type interface to access posts.


Fetching only happens when array methods are called in the chain.

Loading posts directly

You can also load posts directly using a similar interface :"technology").type("text").all

Or you can load 1 post by Tumblr id :


Post Classes

Every Tumblr entry type is a separate class so you can do stuff like :

case post
when Tumblr::Text
  # Display a regular post
when Tumblr::Quote
  # Display a quote
when Tumblr::Photo
  # Display a photo

This makes custom display easier.

Known Issues

There's no testing or real documentation. I know, wanna help?

This isn't the same...

If you were using Tumblrb 1.0, this is completely different. I realize that. However, I didn't think anyone was using that gem and I think this is a better more holistic solution. Sorry for the inconvenience.

Anything else?

Questions, requests, concerns? Find me at the gorgon lab