module Tumblr::Blog

Public Instance Methods

avatar(blog_name, size = nil) click to toggle source

Gets the avatar URL of specified size

# File lib/tumblr/blog.rb, line 10
def avatar(blog_name, size = nil)
  url = blog_path(blog_name, 'avatar')
  url = "#{url}/#{size}" if size
  get_redirect_url(url)
end
blog_info(blog_name) click to toggle source

Gets the info about the blog

# File lib/tumblr/blog.rb, line 5
def blog_info(blog_name)
  get(blog_path(blog_name, 'info'), :api_key => @consumer_key)
end
blog_likes(blog_name, options = {}) click to toggle source

Gets the list of likes for the blog

# File lib/tumblr/blog.rb, line 23
def blog_likes(blog_name, options = {})
  validate_options([:limit, :offset, :before, :after], options)
  url = blog_path(blog_name, 'likes')

  params = { :api_key => @consumer_key }
  params.merge! options
  get(url, params)
end
draft(blog_name, options = {}) click to toggle source
# File lib/tumblr/blog.rb, line 48
def draft(blog_name, options = {})
  validate_options([:limit, :offset], options)
  get(blog_path(blog_name, 'posts/draft'), options)
end
followers(blog_name, options = {}) click to toggle source

Gets the list of followers for the blog

# File lib/tumblr/blog.rb, line 17
def followers(blog_name, options = {})
  validate_options([:limit, :offset], options)
  get(blog_path(blog_name, 'followers'), options)
end
posts(blog_name, options = {}) click to toggle source
# File lib/tumblr/blog.rb, line 32
def posts(blog_name, options = {})
  url = blog_path(blog_name, 'posts')
  if options.has_key?(:type)
    url = "#{url}/#{options[:type]}"
  end

  params = { :api_key => @consumer_key }
  params.merge! options
  get(url, params)
end
queue(blog_name, options = {}) click to toggle source
# File lib/tumblr/blog.rb, line 43
def queue(blog_name, options = {})
  validate_options([:limit, :offset], options)
  get(blog_path(blog_name, 'posts/queue'), options)
end
submissions(blog_name, options = {}) click to toggle source
# File lib/tumblr/blog.rb, line 53
def submissions(blog_name, options = {})
  validate_options([:limit, :offset], options)
  get(blog_path(blog_name, 'posts/submission'), options)
end