| 1 |
NAME |
| 2 |
|
| 3 |
Gravatar::URL - Make URLs for Gravatars from an email address |
| 4 |
|
| 5 |
SYNOPSIS |
| 6 |
|
| 7 |
use Gravatar::URL; |
| 8 |
|
| 9 |
my $gravatar_id = gravatar_id($email); |
| 10 |
|
| 11 |
my $gravatar_url = gravatar_url(email => $email); |
| 12 |
|
| 13 |
DESCRIPTION |
| 14 |
|
| 15 |
A Gravatar is a Globally Recognized Avatar for a given email address. |
| 16 |
This allows you to have a global picture associated with your email |
| 17 |
address. You can look up the Gravatar for any email address by |
| 18 |
constructing a URL to get the image from gravatar.com. This module does |
| 19 |
that. |
| 20 |
|
| 21 |
Examples of use include the author faces on http://search.cpan.org. |
| 22 |
|
| 23 |
See http://gravatar.com for more info. |
| 24 |
|
| 25 |
Functions |
| 26 |
|
| 27 |
gravatar_url |
| 28 |
|
| 29 |
# By email |
| 30 |
my $url = gravatar_url( email => $email, %options ); |
| 31 |
|
| 32 |
# By gravatar ID |
| 33 |
my $url = gravatar_url( id => $id, %options ); |
| 34 |
|
| 35 |
Constructs a URL to fetch the gravatar for a given $email or $id. |
| 36 |
|
| 37 |
$id is a gravatar ID. See "gravatar_id" for more information. |
| 38 |
|
| 39 |
%options are optional and are... |
| 40 |
|
| 41 |
rating |
| 42 |
|
| 43 |
A user can rate how offensive the content of their gravatar is, like a |
| 44 |
movie. The ratings are g, pg, r and x. If you specify a rating it is |
| 45 |
the highest rating that will be given. |
| 46 |
|
| 47 |
rating => "r" # includes g, pg and r |
| 48 |
|
| 49 |
size |
| 50 |
|
| 51 |
Specifies the desired width and height of the gravatar (gravatars are |
| 52 |
square). |
| 53 |
|
| 54 |
Valid values are from 1 to 512 inclusive. Any size other than 80 may |
| 55 |
cause the original gravatar image to be downsampled using bicubic |
| 56 |
resampling before output. |
| 57 |
|
| 58 |
size => 40, # 40 x 40 image |
| 59 |
|
| 60 |
default |
| 61 |
|
| 62 |
The url to use if the user has no gravatar or has none that fits your |
| 63 |
rating requirements. |
| 64 |
|
| 65 |
default => "https://secure.wikimedia.org/wikipedia/en/wiki/File:Mad30.jpg" |
| 66 |
|
| 67 |
Relative URLs will be relative to the base (ie. gravatar.com), not your |
| 68 |
web site. |
| 69 |
|
| 70 |
Gravatar defines special values that you may use as a default to |
| 71 |
produce dynamic default images. These are "identicon", "monsterid", |
| 72 |
"wavatar" and "retro". "404" will cause the URL to return an HTTP 404 |
| 73 |
"Not Found" error instead whereas "mm" will display the same "mystery |
| 74 |
man" image for all missing people. See |
| 75 |
http://en.gravatar.com/site/implement/url for more info. |
| 76 |
|
| 77 |
If omitted, Gravatar will serve up their default image, the blue G. |
| 78 |
|
| 79 |
border |
| 80 |
|
| 81 |
DEPRECATED! This key has been removed from the Gravatar protocol. It |
| 82 |
will be removed from future versions of Gravatar::URL. |
| 83 |
|
| 84 |
Gravatars can be requested to have a 1 pixel colored border. If you'd |
| 85 |
like that, pass in the color to border as a 3 or 6 digit hex string. |
| 86 |
|
| 87 |
border => "000000", # a black border, like my soul |
| 88 |
border => "000", # black, but in 3 digits |
| 89 |
|
| 90 |
base |
| 91 |
|
| 92 |
This is the URL of the location of the Gravatar server you wish to grab |
| 93 |
Gravatars from. Defaults to http://www.gravatar.com/avatar/" for HTTP |
| 94 |
and https://secure.gravatar.com/avatar/ for HTTPS. |
| 95 |
|
| 96 |
short_keys |
| 97 |
|
| 98 |
If true, use short key names when constructing the URL. "s" instead of |
| 99 |
"size", "r" instead of "ratings" and so on. |
| 100 |
|
| 101 |
short_keys defaults to true. |
| 102 |
|
| 103 |
https |
| 104 |
|
| 105 |
If true, serve avatars over HTTPS instead of HTTP. |
| 106 |
|
| 107 |
You should select this option if your site is served over HTTPS to |
| 108 |
avoid browser warnings about the presence of insecure content. |
| 109 |
|
| 110 |
https defaults to false. |
| 111 |
|
| 112 |
gravatar_id |
| 113 |
|
| 114 |
my $id = gravatar_id($email); |
| 115 |
|
| 116 |
Converts an $email address into its Gravatar $id. |
| 117 |
|
| 118 |
THANKS |
| 119 |
|
| 120 |
Thanks to gravatar.com for coming up with the whole idea and Ashley |
| 121 |
Pond V from whose Template::Plugin::Gravatar I took most of the |
| 122 |
original code. |
| 123 |
|
| 124 |
LICENSE |
| 125 |
|
| 126 |
Copyright 2007 - 2009, Michael G Schwern <[email protected]>. Copyright |
| 127 |
2011, Francois Marier <[email protected]>. |
| 128 |
|
| 129 |
This program is free software; you can redistribute it and/or modify it |
| 130 |
under the same terms as Perl itself. |
| 131 |
|
| 132 |
See http://dev.perl.org/licenses/artistic.html |
| 133 |
|
| 134 |
SEE ALSO |
| 135 |
|
| 136 |
Template::Plugin::Gravatar - a Gravatar plugin for Template Toolkit |
| 137 |
|
| 138 |
http://www.gravatar.com - The Gravatar web site |
| 139 |
|
| 140 |
http://en.gravatar.com/site/implement/url - The Gravatar URL |
| 141 |
implementor's guide |
| 142 |
|