NAME

Yahoo::Photos - Manage Yahoo Photos

VERSION

This document describes Yahoo::Photos version 0.0.2

SYNOPSIS

    # 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);

DESCRIPTION

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.

INTERFACE

new

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.

credfile
    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".

albums
    my @albums = $yp->albums;

Returns the list of albums.

create_album
    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.

delete
    $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.

upload
    $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.

verbose
    $yp->upload(1);

Set this to a true value to make "upload" report progress.

EXPORTS

Nothing.

DIAGNOSTICS

no user in login
no pass in login
no user in credentials file
no pass in credentials file
wrong user or pass

Yahoo 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 10

From YAML: new dies if it cannot read the YAML file.

From HTTP::Request::Common: upload dies if it cannot read photo files.

CONFIGURATION AND ENVIRONMENT

$credfile in new is the path to a YAML file that looks like this:

    ---
    user: SUPERHAPPYFUNUSER
    pass: SUPERHAPPYFUNPASS

DEPENDENCIES

Core modules: Carp, File::Spec::Functions, List::Util

CPAN modules: Class::Spiffy, File::HomeDir, HTTP::Cookies::Netscape, Perl::Version, Readonly, WWW::Mechanize, YAML

INCOMPATIBILITIES

None reported.

BUGS AND LIMITATIONS

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/.

TODO

  • change album name, description, title, access

  • rename, delete, sort, move, copy photos

Suggest more future plans by filing a bug.

AUTHOR

Lars Dɪᴇᴄᴋᴏᴡ <daxim@cpan.org>

LICENCE AND COPYRIGHT

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.

DISCLAIMER OF WARRANTY

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.

SEE ALSO

yahoo-photos, Yahoo::Photos::Album

1 POD Error

The following errors were encountered while parsing the POD:

Around line 590:

Non-ASCII character seen before =encoding in 'Dɪᴇᴄᴋᴏᴡ'. Assuming UTF-8