module Tumblife::Client::Blog

Public Instance Methods

avatar(blog, size = 64) click to toggle source

Retrieve a Blog Avatar

@see www.tumblr.com/docs/en/api/v2#blog-avatar @authentication None @param blog [String] The standard or custom blog hostname @param size [Integer] The size of the avatar (square, one value for both length and width). Must be one of the values: 16, 24, 30, 40, 48, 64, 96, 128, 512 @return [Hashie::Mash]

# File lib/tumblife/client/blog.rb, line 23
def avatar(blog, size = 64)
  get("/v2/blog/#{blog}/avatar", :size => size)
end
blog_info(blog) click to toggle source

Retrieve Blog Info

@see www.tumblr.com/docs/en/api/v2#blog-info @authentication API Key @param blog [String] The standard or custom blog hostname @return [Hashie::Mash]

# File lib/tumblife/client/blog.rb, line 12
def blog_info(blog)
  get("/v2/blog/#{blog}/info", :api_key => consumer_key)
end
draft(blog) click to toggle source

Retrieve Draft Posts

@see www.tumblr.com/docs/en/api/v2#blog-drafts @authentication OAuth @param blog [String] The standard or custom blog hostname @return [Hashie::Mash]

# File lib/tumblife/client/blog.rb, line 76
def draft(blog)
  get("/v2/blog/#{blog}/posts/draft")
end
followers(blog, options = {}) click to toggle source

Retrieve a Blog's Followers

@see www.tumblr.com/docs/en/api/v2#blog-followers @authentication OAuth @param blog [String] The standard or custom blog hostname @param options [Hash] An optional options hash @option options [Integer] :limit (20) The number of results to return: 1–20, inclusive @option options [Integer] :offset (0) Result to start at @return [Hashie::Mash]

# File lib/tumblife/client/blog.rb, line 36
def followers(blog, options = {})
  get("/v2/blog/#{blog}/followers", options)
end
posts(blog, options = {}) click to toggle source

Retrieve Published Posts

@see www.tumblr.com/docs/en/api/v2#posts @authentication API Key @param blog [String] The standard or custom blog hostname @param options [Hash] An optional options hash @option options [String] :type (nil) The type of post to return. Specify one of the following: text, quote, link, answer, video, audio, photo, chat @option options [Integer] :id (nil) A specific post ID. Returns the single post specified or (if not found) a 404 error. @option options [String] :tag (nil) Limits the response to posts with the specified tag @option options [Integer] :limit (20) The number of posts to return: 1–20, inclusive @option options [Integer] :offset (0) Post number to start at @option options [Boolean] :reblog_info (false) Indicates whether to return reblog information (specify true or false). Returns the various reblogged_ fields. @option options [Boolean] :notes_info (false) Indicates whether to return notes information (specify true or false). Returns note count and note metadata. @option options [String] :filter (nil) Specifies the post format to return, other than HTML: text – (Plain text, no HTML), raw – (As entered by the user (no post-processing); if the user writes in Markdown, the Markdown will be returned rather than HTML) @return [Hashie::Mash]

# File lib/tumblife/client/blog.rb, line 55
def posts(blog, options = {})
  options[:api_key] = consumer_key
  get("/v2/blog/#{blog}/posts", options)
end
queue(blog) click to toggle source

Retrieve Queued Posts

@see www.tumblr.com/docs/en/api/v2#blog-queue @authentication OAuth @param blog [String] The standard or custom blog hostname @return [Hashie::Mash]

# File lib/tumblife/client/blog.rb, line 66
def queue(blog)
  get("/v2/blog/#{blog}/posts/queue")
end
submission(blog) click to toggle source

Retrieve Submission Posts

@see www.tumblr.com/docs/en/api/v2#blog-submissions @authentication OAuth @param blog [String] The standard or custom blog hostname @return [Hashie::Mash]

# File lib/tumblife/client/blog.rb, line 86
def submission(blog)
  get("/v2/blog/#{blog}/posts/submission")
end