
Yahoo::Photos - Manage Yahoo Photos

This document describes Yahoo::Photos version 0.0.2

# This is the programmatic interface.
# The distribution also ships with a handy wrapper script
# for simple uploading from the shell,
# its documentation is linked at the end of this file.
use Yahoo::Photos qw();
my $yp = Yahoo::Photos->new(
credentials => undef,
);
my $album = $yp->create_album(
name => 'Visiting the zoo',
access => 'public',
);
$yp->upload(
album => $album,
files => [glob('dscf*.jpg')],
);
$yp->delete_album($album);

With this module, you can manage your albums on Yahoo Photos (http://photos.yahoo.com/). Currently creating and deleting albums and uploading photos is implemented.
I wrote it because the Firefox mass-upload addon provided by Yahoo does not work anymore.

Pick one of the following three ways to authenticate against Yahoo.
my $yp = Yahoo::Photos->new(
login => {
user => $user,
pass => $pass,
},
);
$user and $pass are the same what you would type into the form at https://login.yahoo.com/.
my $yp = Yahoo::Photos->new(
credentials => $credfile,
);
You can store the credentials on the file system for convenience. Instead of an explicite filename, you can also pass undef, the default credentials file location is then used.
my $yp = Yahoo::Photos->new(
cookie => $cookiefile,
);
Simplify the authentification by reusing your browser cookies. $cookiefile is the path to a Netscape-style cookie file, e.g. on Linux $ENV{HOME}/.mozilla/firefox/a1b2c3d4.default/cookies.txt.
print Yahoo::Photos->credfile;
Returns the path to the default location of the credentials YAML file. For the description of the file see "CONFIGURATION AND ENVIRONMENT".
my @albums = $yp->albums;
Returns the list of albums.
my $album = $yp->create_album;
my $album = $yp->create_album(
name => 'Visiting the zoo',
access => 'public',
);
my $album = $yp->create_album(
access => 'friends_only',
yahoo_ids => [qw(yahooligan5678 roxorfan573 the7jump)],
over_18_only => 1,
restrict_prints => 1,
);
Creates an album. If no name is given, defaults to the ISO 8601 date as given by Yahoo. If no access is given, defaults to private. Access can be private, public or friends_only. If friends_only is given, you should also provide to the key yahoo_ids an arrayref of Yahoo IDs. It is okay to omit the whole yahoo_ids altogether. You can restrict access to users aged at least 18 years by passing true to the key over_18_only. You can restrict photo print ordering by passing true to the key restrict_prints.
Returns the newly created album.
$yp->delete_album($album);
Deletes the album.
Warning! There is no confirmation and no undo, so make 100% sure you are picking the right album.
$yp->upload(
album => $album,
files => [glob('dscf*.jpg')],
at_a_time => 3,
);
Upload photos into the album in batches of at_a_time files. album is mandatory, pass an album. files is mandatory, pass an arrayref of paths to files. at_a_time is optional, defaults to 10, it must be a number between 1 and 10.
$yp->upload(1);
Set this to a true value to make "upload" report progress.

Nothing.

decide on one way build the constructor: login or credentials or cookie
no user in login
no pass in login
no user in credentials file
no pass in credentials file
no cookie file path given
cookie file does not exist
cookie file not readable
no login or cookie or credentials in constructor
wrong user or passYahoo did not accept your user or pass.
access must be one of private or public or friends_only
value to yahoo_ids must be an arrayref
no album given to delete_album
no album given for upload
no files given for upload
value to files must be an arrayref
at_a_time must be between 1 and 10From YAML: new dies if it cannot read the YAML file.
From HTTP::Request::Common: upload dies if it cannot read photo files.

$credfile in new is the path to a YAML file that looks like this:
---
user: SUPERHAPPYFUNUSER
pass: SUPERHAPPYFUNPASS

Core modules: Carp, File::Spec::Functions, List::Util
CPAN modules: Class::Spiffy, File::HomeDir, HTTP::Cookies::Netscape, Perl::Version, Readonly, WWW::Mechanize, YAML

None reported.

No bugs have been reported.
Please report any bugs or feature requests to bug-yahoo-photos@rt.cpan.org, or through the web interface at https://rt.cpan.org/.

Suggest more future plans by filing a bug.

Lars Dɪá´á´á´á´á´¡ <daxim@cpan.org>

Copyright (c) 2007, Lars Dɪá´á´á´á´á´¡ <daxim@cpan.org>.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE »AS IS« WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
