Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

bump version, add docs

  • Loading branch information...
commit 2c530015aece4eacd852e315f4db615ffe1e82d9 1 parent 940d2f8
Aubrey Holland authored
Showing with 31 additions and 1 deletion.
  1. +30 −0 README.md
  2. +1 −1  lib/tumble.rb
View
30 README.md
@@ -6,6 +6,36 @@ A Ruby wrapper for the v2 of Tumblr's API, supporting all endpoints.
## <a name="configuration"></a>Configuration
+The gem is designed to work with Tumblr's OAuth provider for authentication. If you're using omniauth,
+there's a fine adapter available [here][https://github.com/aub/omniauth-tumblr2]. You'll also need to
+register your app [here][http://www.tumblr.com/oauth/apps] in order to get a consumer key and secret.
+Once you have those values, you can configure Tumble in an initializer like so:
+
+ require 'tumble'
+
+ Tumble.configure do |tumble|
+ tumble.consumer_key = config['tumblr']['key']
+ tumble.consumer_secret = config['tumblr']['secret']
+ end
+
+Connections can then be made by creating a client, passing the OAuth token and secret you get back from
+omniauth:
+
+ client = Tumble::Client.new(access_token, access_secret)
+
+User-related endpoints can be accessed through the client directly, as documented [here][http://rdoc.info/github/aub/tumble/Tumble/Client].
+For example:
+
+ client.user_info
+
+All methods will return a Hashie::Mash of the results. For data about blogs and posts, use the blog() method on
+the client, passing the name of the blog. The methods for blogs are documented [here][http://rdoc.info/github/aub/tumble/Tumble/Blog].
+For example, getting posts for a specific blog can be done like this:
+
+ client.blog('www.riotprojects.com').posts
+
+Most of the calls allow for options to be passed, as a hash. Options are documented in the links above and are consistent
+with the naming and functionality described in the [Tumblr docs][https://github.com/aub/omniauth-tumblr2].
## <a name="documentation"></a>Documentation
[http://rdoc.info/github/aub/tumble][documentation]
View
2  lib/tumble.rb
@@ -3,7 +3,7 @@
end
module Tumble
- VERSION = '0.0.8'
+ VERSION = '0.1.0'
def self.configure
yield Config
Please sign in to comment.
Something went wrong with that request. Please try again.