Subject: | support for authkey parameter |
I'd like the Picasa module to support fetching images from a hidden
album, by using a provided authkey parameter. I've attached a patch
that adds this functionality.
See also http://code.google.com/apis/picasaweb/faq.html#unlisted_albums
It'd be great if this was included in a future release. Thanks for module!
Subject: | Photo.pm.authkey.patch |
--- Photo.pm 2008-06-04 22:55:29.000000000 -0400
+++ Photo.pm.new 2008-06-04 22:55:50.000000000 -0400
@@ -21,17 +21,16 @@
my $photos_feed_url = "http://picasaweb.google.com/data/feed/api/user/".$options->{'userid'};
$photos_feed_url .= "/album/".$options->{'album'} if(defined $options->{'album'});
$photos_feed_url .= '?kind=photo';
- my ($album_exists,$numphotos) = _check_exists_album($self,$options) if(defined $options->{'album'});
- if (defined $options->{'album'}) {
- die "Album ".$options->{'album'}." not there for user ".$options->{'userid'}."\n" if($album_exists == 0);
- die "There are no photos in album ".$options->{'album'}."\n" if ($numphotos == 0);
- }
+ $photos_feed_url .= '&authkey='.$options->{'authkey'} if(defined $options->{'authkey'});
if (defined $options->{'access'} and $options->{'access'} eq 'private') {
$response = $self->new->get($photos_feed_url,'Authorization'=>"$Picasa::authorization");
}
else {
$response = $self->new->get($photos_feed_url);
}
+ if(!$response->is_success) {
+ die "Album ".$options->{'album'}." not there for user ".$options->{'userid'}.". (" . $response->status_line . ")\n";
+ }
_parse_photo_response($response->content);
download_photos($self,$options);
}