diff --git a/lib/ruby_picasa/types.rb b/lib/ruby_picasa/types.rb index efdc065..52e5394 100644 --- a/lib/ruby_picasa/types.rb +++ b/lib/ruby_picasa/types.rb @@ -286,8 +286,12 @@ def coords [lat, lng] end end + + class License < Objectify::ElementParser + attributes :id, :name, :url + end - namespaces 'exif', 'georss', 'gml' + namespaces 'exif', 'georss', 'gml', 'gphoto' attributes :published, :summary, @@ -316,6 +320,7 @@ def coords has_one :point, RubyPicasa::Photo::Point, 'gml:Point' has_one :author, Objectify::Atom::Author, 'author' + has_one :license, RubyPicasa::Photo::License, 'gphoto:license' end diff --git a/spec/ruby_picasa/types_spec.rb b/spec/ruby_picasa/types_spec.rb index 16d1201..588ddde 100644 --- a/spec/ruby_picasa/types_spec.rb +++ b/spec/ruby_picasa/types_spec.rb @@ -193,6 +193,12 @@ it 'should have a content' do @photo.content.should be_an_instance_of(PhotoUrl) end + + it 'should have a license' do + @photo.license.should be_an_instance_of(Photo::License) + @photo.license.id.should == 0 + @photo.license.name.should == "All Rights Reserved" + end it 'should have 3 thumbnails' do @photo.thumbnails.length.should == 3 diff --git a/spec/sample/album.atom b/spec/sample/album.atom index 0726373..f468819 100644 --- a/spec/sample/album.atom +++ b/spec/sample/album.atom @@ -106,6 +106,7 @@ xmlns:gphoto='http://schemas.google.com/photos/2007'> 1218826724000 + ALL_RIGHTS_RESERVED 0657130896bace739a44ce90a7d5b451 diff --git a/spec/sample/search-geo-1-result.atom b/spec/sample/search-geo-1-result.atom index 1f97989..2d3ebb2 100644 --- a/spec/sample/search-geo-1-result.atom +++ b/spec/sample/search-geo-1-result.atom @@ -1 +1,84 @@ -http://picasaweb.google.com/data/feed/api/all2009-11-30T12:22:31.853ZSearch ResultsPicasaweb249451110http://picasaweb.google.com/data/entry/api/user/mcrosetti/albumid/5038536056381788481/photoid/54098652397747115222009-11-30T12:00:05.000Z2009-11-30T12:22:31.853ZUno más.jpgCena de Navidad con compañeros del fútbolMaxitohttp://picasaweb.google.com/mcrosettimcrosettiMaxitohttp://lh3.ggpht.com/_SHCEk4XiaxY/AAAAFW54aRs/AAAAAAAAAAA/bxWLJruI9NQ/s32-c/mcrosetti.jpgmcrosetti5409865239774711522141.92473421E95038536056381788481public64048061758picasa77e2c0241259539121000675002.8CanonCanon DIGITAL IXUS 600.016666668true5.81259539121000358e5f03385d40c41dfdf3ad9a80868cMaxitoCena de Navidad con compañeros del fútbolUno más.jpg-9.6481127 -103.725899290.0 96.313163240.434988 -3.706368Madrid - Los mejores momentosMadridLosMejoresMomentosLas mejores fotos en MadridMadridPHOTO_DESCRIPTION0 \ No newline at end of file + + + http://picasaweb.google.com/data/feed/api/all + 2009-11-30T12:22:31.853Z + Search Results + + + + Picasaweb + 24945 + 1 + 1 + 10 + + http://picasaweb.google.com/data/entry/api/user/mcrosetti/albumid/5038536056381788481/photoid/5409865239774711522 + 2009-11-30T12:00:05.000Z + 2009-11-30T12:22:31.853Z + + Uno más.jpg + Cena de Navidad con compañeros del fútbol + + + + + + + + Maxito + http://picasaweb.google.com/mcrosetti + mcrosetti + Maxito + http://lh3.ggpht.com/_SHCEk4XiaxY/AAAAFW54aRs/AAAAAAAAAAA/bxWLJruI9NQ/s32-c/mcrosetti.jpg + mcrosetti + + 5409865239774711522 + 14 + 1.92473421E9 + 5038536056381788481 + public + 640 + 480 + 61758 + picasa + 77e2c024 + 1259539121000 + 6750 + 0 + + 2.8 + Canon + Canon DIGITAL IXUS 60 + 0.016666668 + true + 5.8 + 1259539121000 + 358e5f03385d40c41dfdf3ad9a80868c + + + + Maxito + Cena de Navidad con compañeros del fútbol + + + + Uno más.jpg + + + + -9.6481127 -103.7258992 + 90.0 96.3131632 + + + 40.434988 -3.706368 + + + Madrid - Los mejores momentos + MadridLosMejoresMomentos + Las mejores fotos en Madrid + Madrid + + PHOTO_DESCRIPTION + 0 + +