Skip Menu |

This queue is for tickets about the Net-Google-PicasaWeb CPAN distribution.

Report information
The Basics
Id: 41613
Status: resolved
Priority: 0/
Queue: Net-Google-PicasaWeb

People
Owner: hanenkamp [...] cpan.org
Requestors: iderrick [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Hello, I not sure if there already is a way to choose only some album when fetching with picasa-get. So I give in attachement a patch to picasa-get which allows to give at the end of the command line a list of regexp for selecting albums. 'picasa-get --user-id toto Perl' will only select albums whose title matches .*Perl.* (in order to simplify the writing of the rules). It is mainly a quick and dirty hack, so be careful :) Sorry if I missed something existing. Cheers, Olivier
Subject: choose_album.patch
--- /usr/local/bin/picasa-get 2008-12-11 02:01:43.000000000 +0100 +++ /home_s/olivier/scripts/picasa-get 2008-12-11 02:53:10.000000000 +0100 @@ -52,10 +52,10 @@ if ($kind eq 'album') { $user_id ||= 'default'; - + my @wanted = @ARGV; $options{user_id} = $user_id; my @albums = $service->list_albums(%options); - &download_albums(@albums); + &download_albums(\@wanted, @albums); } else { @@ -73,10 +73,14 @@ } sub download_albums { + my $wanted = shift; my @albums = @_; ALBUM: for my $album (@albums) { + if (@{$wanted}) { + next ALBUM unless grep {$album->title =~ /.*$_.*/} @{$wanted}; + } my $dir_name = to_filename($album->title); if (-e $dir_name) { warn "$0: $dir_name exists, will not overwrite\n";
The new version of the scripts I just released yesterday may help some with this, but I still don't provide a way to select the item you want by name. However, it would be very nice to have a way to say something like: ./picasa list photos --username hanenkamp --album-name '\bOSCON\b' to list all the photos belonging to an album that contains the word "OSCON". I'd be willing to add something like that for the next release.
On Wed Dec 10 20:57:22 2008, IDERRICK wrote: Show quoted text
> I not sure if there already is a way to choose only some album when > fetching with picasa-get. So I give in attachement a patch to picasa-get > which allows to give at the end of the command line a list of regexp for > selecting albums.
I added a similar feature. In the latest release that will be available on CPAN shortly. There's a new --find-album and --find-photo on picasa-get and a --find on picasa-list. These allow you to match exactly or on the basis of a regular expression on several fields. Cheers, Sterling