NAME

Net::Pavatar - Pavatar client

VERSION

Version 1.01

SYNOPSIS

use Net::Pavatar;

my ($hash, $file_type) = Net::Pavatar->fetch( 'http://someblog.com/', { size => [32, 48] } );

if ($file_type) {
    open FILE, ">avatar.$file_type";
    print FILE $hash->{'48'};
    close FILE;
}

DESCRIPTION

Fetches a pavatar image from a given URL and gives it to you in the sizes you specify. Uses LWPx::ParanoidAgent to protect your servers from attacks.

This module fully conforms to Pavatar spec 0.3.0 (http://pavatar.com/spec/pavatar-0.3.0), which is the latest one on Apr 25th, 2007.

METHODS

my ($hashref, $type) = Net::Pavatar->fetch( $url, \%opts )

Returns a hashref and a string, as a 2-list. The hash contains the image sizes as keys, and the image data for each size as values. The string contains the image type and can either be 'jpeg', 'png' or 'gif'. If a pavatar does not exist, or is not valid for any reason, returns null.

The \%opts hashref is optional, and accepts the following keys:

size : the sizes that you want the pavatar image returned in - defaults to 80

timeout : the total time that UserAgent is allowed to retrieve each page or image - defaults to 15

e.g. Net::Pavatar->fetch( $url, { size => [32, 48], timeout => 25 } )

AUTHOR

Alexander Karelas, <karjala at karjala.org>

BUGS

Please report any bugs or feature requests to bug-net-pavatar at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Pavatar. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Net::Pavatar

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2007 Alexander Karelas, all rights reserved.

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