NAME WWW::Ofoto - A module to interact with the Ofoto (now Kodakgallery) website SYNOPSIS use WWW::Ofoto; my $ofoto = WWW::Ofoto->new( { email => 'me@home.com', passwd => 'mypasswd', } ); # login to your account $ofoto->login() or die "couldn't login"; # get a hash of your current photo albums use DateTime; my $albums = $ofoto->list_albums; for my $album (keys %$albums){ my $album = $albums->{$name}; printf "Album %s has %d photos and was created on %s\n", $name, $album->{count}, $album->{date}->mdy; } # upload photos to a new album $count = $ofoto->upload_new_album( { title => 'Nov 2005 Beach', desc => 'Pictures from my beach vacation', date => DateTime->now, pics => [ 'pic1.jpg', 'pic2.jpg' ], } ); # upload photos to an existing album $result = $ofoto->upload_to_album( { title => 'Nov 2005 Beach', pics => [ 'pic3.jpg', 'pic4.jpg'], } ); DESCRIPTION This module provides a basic interface to the Ofoto (now KodakGallery) website ("http://www.ofoto.com/" or "http://wwww.kodakgallery.com/"). It is based on the excellent "WWW::Mechanize" module by Andy Lester. I also requires the "DateTime" module to handle dates. CLASS METHODS new() my $ofoto = WWW::Ofoto->new( { email => 'me@home.com', passwd => 'mypasswd', } ); Constructor - Creates and returns a new "WWW::Ofoto" object. Typically you will want to pass in your email and password for the Ofoto site, but they can be set later via accessors. Returns the created object or croaks if there is error. OBJECT METHODS $ofoto->login() $ofoto->login() or die "couldn't login"; Logs into the Ofoto website using the email and password supplied in the constructor or through the "email" and "passwd" accessors. Returns true if the login was successful. $ofoto->list_albums() my $albums = $ofoto->list_albums; Retrieves a summary the user's photo albums from the Ofoto website. Which is returned as a reference to a hash of hashes. Croaks or returns an empty hash if there is an error. The photo album titles are the keys to the hash, and "count", "date", and "link" are the keys to the value hash: for my $album (keys %$albums){ my $album = $albums->{$name}; printf "Album %s has %d photos and was created on %s\n", $name, $album->{count}, $album->{date}->mdy; } $ofoto->upload_new_album() $count = $ofoto->upload_new_album( { title => 'Nov 2005 Beach', desc => 'Pictures from my beach vacation', date => DateTime->now, pics => [ 'pic1.jpg', 'pic2.jpg' ], } ); Takes a the relevant data, creates a new album and uploads the pictures to the Ofoto site. A large number of photos may be sent with each call to "upload_new_album". The method will break the photos into smaller groups and upload each. Will most likely croak if there is any error. The number of photos uploaded is returned. $ofoto->upload_to_album() $result = $ofoto->upload_to_album( { title => 'Nov 2005 Beach', pics => [ 'pic3.jpg', 'pic4.jpg'], } ); Uploads pictures to an existing photo album based on the c