Sha256: 1ee7c2933c6b2d618c4d8bbffb4e550333c4e53706e0af9ad8141d6bda8e58d2

Contents?: true

Size: 1.62 KB

Versions: 1

Compression:

Stored size: 1.62 KB

Contents

= Tumblr

Tumblr is a rails gem that allows you to use the Tumblr API. The idea is that you don't have to worry about HTTP requests, you just want to fetch your posts right? But there's more; you can also create, update and destroy Tumblr posts and do so as railsy as possible.

== Fetching Posts

Fetching posts is easy. The first thing you have to do is tell the Tumblr gem which blog we're talking about. So, If your blog is located on http://myblog.tumblr.com you do this:

  Tumblr.blog = 'myblog'

When just fetching posts, you don't have to worry about authentication, so let's go and get your posts now, shall we?

  @posts = Tumblr::Post.all

Congratulations! Now you've got all - with a maximum of 50 - of your posts!

Want the first/last post? No problem:

  @posts = Tumblr::Post.first # gets the first post it can find
  @posts = Tumblr::Post.last  # gets the last post it can find

And when you want a specific post, you can always just do this:
  
  @posts = Tumblr::Post.find(12345) # gets the post with ID = 12345

== Parameters

Tumblr allows you to pass some parameters to you requests. In the functions described above, the Tumblr gem automatically sets the +:start+, +:num+ and/or +:id+ parameters. But you can add more!

  @posts = Tumblr::Post.all(:type => 'photo') # gets all posts with type = 'photo'
  @posts = Tumblr::Post.all(:filter => 'text') # gets all posts in plain text

Please check out http://www.tumblr.com/docs/api for Tumblr's full documentation about their API and the parameters.

== Docs

http://rdoc.info/projects/jeffkreeftmeijer/tumblr

== Copyright

Copyright (c) 2009 Jeff Kreeftmeijer. See LICENSE for details.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jeffkreeftmeijer-tumblr-0.0.4 README.rdoc