The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Flickr::API::People - The Perl interface to the Flickr API's flickr.people.* methods.

VERSION

Version 0.01

SYNOPSIS

    use Flickr::API::People;

    my $flickrpeople = Flickr::API::People->new($my_flickr_api_key);
    
    my $personhash = $flickrpeople->findByUsername($username);
    or
    my $personhash = $flickrpeople->findByEmail($email);

    print $personhash->{'nsid'};
    print $personhash->{'username'};

    my $person_info = $flickrpeople->getInfo($personhash->{id});

DESCRIPTION

This module maps the Flickr API's flickr.people.* methods.

Each method from the Flickr API has a counterpart method in this class (the one's I've mapped already, that is).

The mapping is done by placing each unique piece of information (name, id, location, etc) on the main-level hash and everything that may have multiple instances (the list of public photos from the user, for instance) on a array inside that main hash.

Mainly I've just tried to use common sense when deciding how to map something. Please feel free to send suggestions or insights on this subject.

Under the hood this class uses the Flickr::API class to handle the actual communication with Flickr's servers.

See the flickr API documentation <http://www.flickr.com/services/api> for the full description of each method and it's return values.

METHODS

new

Takes the Flickr API key as the 'key' parameter and sets up the object for further requests.

$flickrpeople = Flickr::API::People->new($my_flickr_api_ke, $my_flickr_email, $my_flickr_password});

The 'my_flickr_email' and 'my_flickr_password' parameters are optional. If you wish to retreive pictures which are not public but are acessible to your account you should pass these parameters along and all further communication with Flickr will be authenticated with this data.

findByUsername

Mapping for the method flickr.people.findByUsername which searches for the person with the username given.

$person = $flickrpeople->findByUsername($username);

The result is a hash similar to the following one (for a full list of the return values to expecti and an explanation of the returned values see the documentation on the Flickr API itself):

{ 'success' => 1, 'id' => '12345678@N00', 'username' => 'Jane Doe', 'nsid' => '12345678@N00' };

findByEmail

Mapping for the method flickr.people.findByEmail which searches for the person with the email given.

$person = $flickrpeople->findByEmail($email);

The result is a hash similar to the following one (for a full list of the return values to expecti and an explanation of the returned values see the documentation on the Flickr API itself):

{ 'success' => 1, 'id' => '12345678@N00', 'username' => 'Jane Doe', 'nsid' => '12345678@N00' };

getInfo

Mapping for the method flickr.people.getInfo which fetches the information on the given person.

$personinfo = $flickrpeople->getInfo($user_id);

The result is a hash similar to the following one (for a full list of the return values to expecti and an explanation of the returned values see the documentation on the Flickr API itself):

{ 'isadmin' => '0', 'realname' => 'Jane Doe', 'success' => 1, 'username' => 'JDoe', 'ispro' => '1', 'photos' => { 'firstdate' => '1097663479', 'count' => '432', 'firstdatetaken' => '2002-10-26 17:48:14' }, 'location' => undef, 'iconserver' => '1', 'id' => '12345678@N00', 'nsid' => '12345678@N00' }

AUTHOR

Nuno Nunes, <nfmnunes@cpan.org>

COPYRIGHT & LICENSE

Copyright 2005 Nuno Nunes, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

Flickr::API, <http://www.flickr.com/>, <http://www.flickr.com/services/api>