Module: Tumblr::Blog
- Included in:
- Client
- Defined in:
- lib/tumblr/blog.rb
Instance Method Summary collapse
-
#avatar(blog_name, size = nil) ⇒ Object
Gets the avatar URL of specified size.
-
#blog_info(blog_name) ⇒ Object
Gets the info about the blog.
-
#blog_likes(blog_name, options = {}) ⇒ Object
Gets the list of likes for the blog.
- #draft(blog_name, options = {}) ⇒ Object
-
#followers(blog_name, options = {}) ⇒ Object
Gets the list of followers for the blog.
- #posts(blog_name, options = {}) ⇒ Object
- #queue(blog_name, options = {}) ⇒ Object
- #submissions(blog_name, options = {}) ⇒ Object
Instance Method Details
#avatar(blog_name, size = nil) ⇒ Object
Gets the avatar URL of specified size
10 11 12 13 14 |
# 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) ⇒ Object
Gets the info about the blog
5 6 7 |
# 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 = {}) ⇒ Object
Gets the list of likes for the blog
23 24 25 26 27 28 29 30 |
# File 'lib/tumblr/blog.rb', line 23 def blog_likes(blog_name, = {}) ([:limit, :offset], ) url = blog_path(blog_name, 'likes') params = { :api_key => @consumer_key } params.merge! get(url, params) end |
#draft(blog_name, options = {}) ⇒ Object
48 49 50 51 |
# File 'lib/tumblr/blog.rb', line 48 def draft(blog_name, = {}) ([:limit, :offset], ) get(blog_path(blog_name, 'posts/draft'), ) end |
#followers(blog_name, options = {}) ⇒ Object
Gets the list of followers for the blog
17 18 19 20 |
# File 'lib/tumblr/blog.rb', line 17 def followers(blog_name, = {}) ([:limit, :offset], ) get(blog_path(blog_name, 'followers'), ) end |
#posts(blog_name, options = {}) ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/tumblr/blog.rb', line 32 def posts(blog_name, = {}) url = blog_path(blog_name, 'posts') if .has_key?(:type) url = "#{url}/#{[:type]}" end params = { :api_key => @consumer_key } params.merge! get(url, params) end |
#queue(blog_name, options = {}) ⇒ Object
43 44 45 46 |
# File 'lib/tumblr/blog.rb', line 43 def queue(blog_name, = {}) ([:limit, :offset], ) get(blog_path(blog_name, 'posts/queue'), ) end |
#submissions(blog_name, options = {}) ⇒ Object
53 54 55 56 |
# File 'lib/tumblr/blog.rb', line 53 def submissions(blog_name, = {}) ([:limit, :offset], ) get(blog_path(blog_name, 'posts/submission'), ) end |