Subject: | patch to support gphoto:timestamp |
Attached is a patch to add support for the gphoto:timestamp property.
http://code.google.com/intl/de-DE/apis/picasaweb/docs/2.0/reference.html#gphoto_timestamp
Subject: | diff.txt |
diff C3 lib/Net/Google/PicasaWeb/MediaEntry.pm lib/Net/Google/PicasaWeb/MediaEntry.pm
*** lib/Net/Google/PicasaWeb/MediaEntry.pm Thu Jan 15 10:14:12 1970
--- lib/Net/Google/PicasaWeb/MediaEntry.pm Thu Jan 15 10:14:12 1970
***************
*** 110,115 ****
--- 110,126 ----
isa => 'Int',
);
+ =head2 timestamp
+
+ The timestamp of the video or photo in bytes.
+
+ =cut
+
+ has timestamp => (
+ is => 'rw', # should probably be 'ro'
+ isa => 'Int',
+ );
+
=head1 METHODS
=cut
***************
*** 126,131 ****
--- 137,144 ----
if $entry->field('gphoto:height');
$self->size($entry->field('gphoto:size'))
if $entry->field('gphoto:size');
+ $self->timestamp($entry->field('gphoto:timestamp'))
+ if $entry->field('gphoto:timestamp');
return $self;
};
diff C3 t/offline/Net/Google/PicasaWeb/Test/GetMediaEntry.pm t/offline/Net/Google/PicasaWeb/Test/GetMediaEntry.pm
*** t/offline/Net/Google/PicasaWeb/Test/GetMediaEntry.pm Thu Jan 15 10:14:12 1970
--- t/offline/Net/Google/PicasaWeb/Test/GetMediaEntry.pm Thu Jan 15 10:14:12 1970
***************
*** 13,19 ****
$self->set_response_content('get_media_entry');
};
! test plan => 23, get_media_entry_ok => sub {
my $self = shift;
my $service = $self->service;
--- 13,19 ----
$self->set_response_content('get_media_entry');
};
! test plan => 24, get_media_entry_ok => sub {
my $self = shift;
my $service = $self->service;
***************
*** 35,40 ****
--- 35,41 ----
is($media->author_name, 'Chuck G', 'author_name is Chuck G');
is($media->author_uri, 'http://picasaweb.google.com/captaincool',
'author_uri is correct');
+ is($media->timestamp, '1196770081000', 'timestamp is correct');
my $photo = $media->photo;
is($photo->title, 'Nash2.jpg', 'photo title is correct');