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



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/flickr/blogs.rb', line 25

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



40
41
42
43
44
45
46
47
48
49
# File 'lib/flickr/blogs.rb', line 40

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