=head1 NAME
Mojolicious::Plugin::Gravatar - Globally Recognized Avatars for Mojolicious
=head1 SYNOPSIS
# Mojolicious
$self->plugin('gravatar');
You can pass default size, rating, and default avatar url
$self->plugin('gravatar' => {
size => 60, #default was 80
rating => 'X', #default was PG
default => '
http://example.com/default.png' # default was not value
});
# Mojolicious::Lite
plugin 'gravatar';
# Gravatars in templates
<%= gravatar '
[email protected]' %>
will generate
<img src="
http://www.gravatar.com/avatar/6ad193f57f79ac444c3621370da955e9&s=80&r=PG" alt="Gravatar" height="80" width="80">
<%= gravatar_url '
[email protected]' %> - if you need only url
Also you can overwrite any default config variables
<%= gravatar '
[email protected]', size => 40, rating=> 'X' %>
If you need some styling for img tag:
<span class='gravatar'> <%= gravatar $email %> </span>
and describe in css - ".gravatar img {border: 1px solid white;}"
=head1 DESCRIPTION
This plugin adds gravatar ( L<
http://gravatar.com> ) helpers to your application.
=head1 CONFIG
=head2 default (optional)
The local (any valid absolute image URI) image to use if there is no Gravatar corresponding to the given email.
=head2 size (optional)
Gravatars are square. Size is 1 through 512 (pixels) and sets the width and the height.
=head2 rating (optional)
G|PG|R|X. The maximum rating of Gravatar you wish returned. If you have a family friendly forum, for example, you might set it to "G."
=head1 HELPERS
=head2 gravatar $email [, %options ];
generate img tag for getting avatar from gravatar.com
$email (required) The key to using Gravatars is a hex hash of the user's email. This is generated automatically and sent to gravatar.com as the gravatar_id.
%options (optional) - you can override config parameters . Support all parameters that you have in config
example <img src="
http://www.gravatar.com/avatar/6ad193f57f79ac444c3621370da955e9&s=80&r=PG" alt="Gravatar" height="80" width="80">
=head2 gravatar_url $email [, %options ];
generate url for getting avatar from gravatar.com
$email (required) The key to using Gravatars is a hex hash of the user's email. This is generated automatically and sent to gravatar.com as the gravatar_id.
%options (optional) - you can override config parameters . Support all parameters that you have in config
=head1 VERSION
Version 0.02
=head1 AUTHOR
Viktor Turskyi <
[email protected]>
=head1 CONTRIBUTORS
Nils Diewald (Akron)
=head1 BUGS
Please report any bugs or feature requests to C<bug-mojolicious-plugin-gravatar at rt.cpan.org>, or through
the web interface at L<
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Mojolicious-Plugin-Gravatar>. I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.
Also you can report bugs to Github L<
https://github.com/koorchik/Mojolicious-Plugin-Gravatar/>
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Mojolicious::Plugin::Gravatar
You can also look for information at:
=over 4
=item * RT: CPAN's request tracker
L<
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Mojolicious-Plugin-Gravatar>
=item * AnnoCPAN: Annotated CPAN documentation
L<
http://annocpan.org/dist/Mojolicious-Plugin-Gravatar>
=item * CPAN Ratings
L<
http://cpanratings.perl.org/d/Mojolicious-Plugin-Gravatar>
=item * Search CPAN
L<
http://search.cpan.org/dist/Mojolicious-Plugin-Gravatar/>
=back
=head1 ACKNOWLEDGEMENTS
=head1 LICENSE AND COPYRIGHT
Copyright 2011 "koorchik".
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.
See
http://dev.perl.org/licenses/ for more information.
=cut