Class: Google::Picasa::Album
- Inherits:
-
Object
- Object
- Google::Picasa::Album
- Defined in:
- lib/google-picasa.rb
Instance Attribute Summary collapse
-
#access ⇒ Object
Returns the value of attribute access.
-
#author_name ⇒ Object
Returns the value of attribute author_name.
-
#author_uri ⇒ Object
Returns the value of attribute author_uri.
-
#description ⇒ Object
Returns the value of attribute description.
-
#description_type ⇒ Object
Returns the value of attribute description_type.
-
#edit_url ⇒ Object
Returns the value of attribute edit_url.
-
#id ⇒ Object
Returns the value of attribute id.
-
#image_type ⇒ Object
Returns the value of attribute image_type.
-
#image_url ⇒ Object
Returns the value of attribute image_url.
-
#is_commentable ⇒ Object
Returns the value of attribute is_commentable.
-
#name ⇒ Object
Returns the value of attribute name.
-
#number_of_comments ⇒ Object
Returns the value of attribute number_of_comments.
-
#number_of_photos ⇒ Object
Returns the value of attribute number_of_photos.
-
#picasa_session ⇒ Object
Returns the value of attribute picasa_session.
-
#self_xml_url ⇒ Object
Returns the value of attribute self_xml_url.
-
#thumbnail ⇒ Object
Returns the value of attribute thumbnail.
-
#title ⇒ Object
Returns the value of attribute title.
-
#title_type ⇒ Object
Returns the value of attribute title_type.
-
#user ⇒ Object
Returns the value of attribute user.
-
#xml ⇒ Object
Returns the value of attribute xml.
Instance Method Summary collapse
- #create_photos_from_xml(xml_response) ⇒ Object
-
#initialize ⇒ Album
constructor
A new instance of Album.
- #photos(options = {}) ⇒ Object
Constructor Details
Instance Attribute Details
#access ⇒ Object
Returns the value of attribute access.
408 409 410 |
# File 'lib/google-picasa.rb', line 408 def access @access end |
#author_name ⇒ Object
Returns the value of attribute author_name.
409 410 411 |
# File 'lib/google-picasa.rb', line 409 def @author_name end |
#author_uri ⇒ Object
Returns the value of attribute author_uri.
409 410 411 |
# File 'lib/google-picasa.rb', line 409 def @author_uri end |
#description ⇒ Object
Returns the value of attribute description.
407 408 409 |
# File 'lib/google-picasa.rb', line 407 def description @description end |
#description_type ⇒ Object
Returns the value of attribute description_type.
407 408 409 |
# File 'lib/google-picasa.rb', line 407 def description_type @description_type end |
#edit_url ⇒ Object
Returns the value of attribute edit_url.
415 416 417 |
# File 'lib/google-picasa.rb', line 415 def edit_url @edit_url end |
#id ⇒ Object
Returns the value of attribute id.
404 405 406 |
# File 'lib/google-picasa.rb', line 404 def id @id end |
#image_type ⇒ Object
Returns the value of attribute image_type.
412 413 414 |
# File 'lib/google-picasa.rb', line 412 def image_type @image_type end |
#image_url ⇒ Object
Returns the value of attribute image_url.
412 413 414 |
# File 'lib/google-picasa.rb', line 412 def image_url @image_url end |
#is_commentable ⇒ Object
Returns the value of attribute is_commentable.
411 412 413 |
# File 'lib/google-picasa.rb', line 411 def is_commentable @is_commentable end |
#name ⇒ Object
Returns the value of attribute name.
404 405 406 |
# File 'lib/google-picasa.rb', line 404 def name @name end |
#number_of_comments ⇒ Object
Returns the value of attribute number_of_comments.
410 411 412 |
# File 'lib/google-picasa.rb', line 410 def number_of_comments @number_of_comments end |
#number_of_photos ⇒ Object
Returns the value of attribute number_of_photos.
410 411 412 |
# File 'lib/google-picasa.rb', line 410 def number_of_photos @number_of_photos end |
#picasa_session ⇒ Object
Returns the value of attribute picasa_session.
402 403 404 |
# File 'lib/google-picasa.rb', line 402 def picasa_session @picasa_session end |
#self_xml_url ⇒ Object
Returns the value of attribute self_xml_url.
415 416 417 |
# File 'lib/google-picasa.rb', line 415 def self_xml_url @self_xml_url end |
#thumbnail ⇒ Object
Returns the value of attribute thumbnail.
413 414 415 |
# File 'lib/google-picasa.rb', line 413 def thumbnail @thumbnail end |
#title ⇒ Object
Returns the value of attribute title.
406 407 408 |
# File 'lib/google-picasa.rb', line 406 def title @title end |
#title_type ⇒ Object
Returns the value of attribute title_type.
406 407 408 |
# File 'lib/google-picasa.rb', line 406 def title_type @title_type end |
#user ⇒ Object
Returns the value of attribute user.
405 406 407 |
# File 'lib/google-picasa.rb', line 405 def user @user end |
#xml ⇒ Object
Returns the value of attribute xml.
414 415 416 |
# File 'lib/google-picasa.rb', line 414 def xml @xml end |
Instance Method Details
#create_photos_from_xml(xml_response) ⇒ Object
445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 |
# File 'lib/google-picasa.rb', line 445 def create_photos_from_xml(xml_response) photos = [] Picasa.entries(xml_response).each do |entry| # parse the entry xml element and get the photo object photo = Picasa.parse_photo_entry(entry) # enter session values in photo object photo.picasa_session = PicasaSession.new photo.picasa_session.auth_key = self.picasa_session.auth_key photo.picasa_session.user_id = self.picasa_session.user_id photos << photo end return photos end |
#photos(options = {}) ⇒ Object
421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 |
# File 'lib/google-picasa.rb', line 421 def photos( = {}) userId = [:user_id].nil? ? self.user : [:user_id] albumName = [:album].nil? ? self.name : [:album] albumId = [:album_id].nil? ? self.id : [:album_id] if(albumId != nil && albumId != "") url = "http://picasaweb.google.com/data/feed/api/user/#{userId}/albumid/#{albumId}?kind=photo" else url = "http://picasaweb.google.com/data/feed/api/user/#{userId}/album/#{albumName}?kind=photo" end uri = URI.parse(url) http = Net::HTTP.new(uri.host, uri.port) headers = {"Authorization" => "GoogleLogin auth=#{self.picasa_session.auth_key}"} response = http.get(uri.path, headers) xml_response = response.body photos = self.create_photos_from_xml(xml_response) return photos end |