Class: Flickr::Blogs

Inherits:
APIBase show all
Defined in:
lib/flickr/blogs.rb

Instance Attribute Summary

Attributes inherited from APIBase

#flickr

Instance Method Summary collapse

Methods inherited from APIBase

#initialize

Constructor Details

This class inherits a constructor from Flickr::APIBase

Instance Method Details

#getListObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/flickr/blogs.rb', line 5

def getList()
  return @flickr.blog_cache_lookup if @flickr.blog_cache_lookup
  res = @flickr.call_method('flickr.blogs.getList')
  list = []
  res.elements['/blogs'].each_element do |e|
    att = e.attributes
    list << Flickr::Blog.new(att['id'], att['name'],
                             att['needspassword'].to_i == 1, att['url'])
  end
  @flickr.blog_cache_store(list)
  return list
end

#postPhoto(blog, photo, title, description, blog_password = nil) ⇒ Object

blog can be either an integer blog ID or a Blog object photo can be either an integer photo ID or a Photo object



20
21
22
23
24
25
26
27
28
29
# File 'lib/flickr/blogs.rb', line 20

def postPhoto(blog, photo, title, description, blog_password=nil)
  blog = blog.id if blog.class == Flickr::Blog
  photo = photo.id if photo.class == Flickr::Photo

  args={'blog'=>blog,'photo'=>photo,'title'=>title,
    description=>'description'}
  args['blogs_password'] = blog_password if blog_password

  @flickr.call_method('flickr.blogs.postPhoto',args)
end