ODYNIEC > WebService-Gravatar-0.10 > WebService::Gravatar
[ search.cpan.org |
Kobes search |
report a bug
]
NAME
VERSION
SYNOPSIS
use WebService::Gravatar;
# Create a new instance of WebService::Gravatar
my $grav = WebService::Gravatar->new(email => '[email protected]',
apikey => 'your_API_key');
# Get a list of addresses
my $addresses = $grav->addresses;
if (defined $addresses) {
# Print the userimage URL for each e-mail address
foreach my $email (keys %$addresses) {
print $addresses->{$email}->{'userimage_url'} . "\n";
}
}
else {
# We have a problem
print STDERR "Error: " . $grav->errstr . "\n";
}
# Read image file data
my $data;
{
local $/ = undef;
open(F, "< my_pretty_face.png");
$data = <F>;
close(F);
}
# Save the image as a new userimage
$grav->save_data(data => $data, rating => 0);
...
DESCRIPTION
WebService::Gravatar is a Perl interface to Gravatar API. It aims at providing a close representation of the basic XML-RPC API, as documented on Gravatar website: http://en.gravatar.com/site/implement/xmlrpc/. All the method names, parameter names, and data structures are the same as in the API -- the only exception is that in the API the methods are named with camelCase, while the module uses lowercase_with_infix_underscores.
METHODS
new
- apikey
- password
exists
$result = $grav->exists(hashes => ['e52beb5a6966554a02a56072cafebabe
+',
'62345cdd79773f62a87fcbc6abadbabe'])
- hashes
addresses
$addresses = {
'[email protected]' => {
'rating' => '0',
'userimage' => '8bfc8da2562a53ddd7e630a68badf00d',
'userimage_url' => 'http://en.gravatar.com/userimage/123456/
+8bfc8da2562a53ddd7e630a68badf00d.jpg'
},
'[email protected]' => {
'rating' => '1',
'userimage' => '90f269fe7b67d0ce49f96427deadbabe',
'userimage_url' => 'http://en.gravatar.com/userimage/123456/
+90f269fe7b67d0ce49f96427deadbabe.jpg'
}
};
userimages
$userimages = {
'8bfc8da2562a53ddd7e630a68badf00d' => [
'0',
'http://en.gravatar.com/userimage/123456/8bfc8da2562a53ddd7e
+630a68badf00d.jpg'
],
'90f269fe7b67d0ce49f96427deadbabe' => [
'1',
'http://en.gravatar.com/userimage/123456/90f269fe7b67d0ce49f
+96427deadbabe.jpg'
]
};
save_data
- data
- rating
save_url
- url
- rating
use_userimage
$grav->use_userimage(userimage => '9116aa83a568563290a681df61c0ffee' +. addresses => ['[email protected]', '[email protected]']);
- userimage
- addresses
remove_image
- addresses
delete_userimage
- userimage
test
err
errstr
AUTHOR
BUGS
Please report any bugs or feature requests to bug-webservice-gravatar at rt.cpan.org, or through
the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WebService-Gravatar. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
SUPPORT
- RT: CPAN's request tracker
- AnnoCPAN: Annotated CPAN documentation
- CPAN Ratings
- Search CPAN
COPYRIGHT & LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
- Gravatar XML-RPC API Documentation


