Sha256: 225a86f6f6f4f571f08749d4f0390ef6fe4a0e6e04776e3b698d6a9ad3d501be

Contents?: true

Size: 1.39 KB

Versions: 6

Compression:

Stored size: 1.39 KB

Contents

module Tumblr
  class Client
    module Blog
      
      @@standard_options = [:type, :id, :tag, :limit, :offset, :reblog_info, :notes_info, :filter]
      #
      #Gets the info about the blog
      #
      def blog_info(blog_name)
        get("v2/blog/#{blog_name}/info", {:api_key => Tumblr::consumer_key})
      end
    
      #
      #Gets the avatar of specified size
      #Defaults to 64
      #
      def avatar(blog_name, size=64)
        get("v2/blog/#{blog_name}/avatar", {:size => size})
      end
    
      #
      # Gets the list of followers for the blog
      #
      def followers(blog_name, options={})
        if valid_options([:limit, :offset], options)
           get("v2/blog/#{blog_name}/followers", options)
        end
      end

      def posts(blog_name, options={})
        url = "v2/blog/#{blog_name}/posts"
        
        if options.has_key?(:type)
          url = "#{url}/#{options[:type]}"
        end
        
        params = {:api_key => Tumblr::consumer_key}
        unless options.empty?
          params.merge!(options)
        end
        get(url, params)
      end

      def queue(blog_name)
        get("v2/blog/#{blog_name}/posts/queue", {})
      end
      
      def draft(blog_name)
        get("v2/blog/#{blog_name}/posts/draft", {})
      end
        
      def submissions(blog_name)
        get("v2/blog/#{blog_name}/posts/submission", {})
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
tumblr_client_faraday_0_8-0.6.7.1 lib/tumblr/blog.rb
tumblr_client-0.6.7 lib/tumblr/blog.rb
tumblr_client-0.6.6 lib/tumblr/blog.rb
tumblr_client-0.6.5 lib/tumblr/blog.rb
tumblr_client-0.6.1 lib/tumblr/blog.rb
tumblr_client-0.6 lib/tumblr/blog.rb