.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{
. if \nF \{
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{\
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
.\}
.if t \{\
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
.\}
. \" simple accents for nroff and troff
.if n \{\
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
.\}
.if t \{\
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
. \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o'bp'
. ds Th \o'LP'
. ds ae ae
. ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "Template::Plugin::Gravatar 3pm"
.TH Template::Plugin::Gravatar 3pm "2014-10-14" "perl v5.20.1" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "Name"
.IX Header "Name"
Template::Plugin::Gravatar \- Configurable TT2\-based generation of Gravatar URLs from email addresses.
.SH "Version"
.IX Header "Version"
0.08
.SH "Synopsis"
.IX Header "Synopsis"
.Vb 5
\& [% USE Gravatar %]
\& [% FOR user IN user_list %]
\&
\& [% END %]
\&
\& # OR a mini CGI example
\& use strict;
\& use CGI qw( header start_html end_html );
\& use Template;
\&
\& my %config = ( # ... your other config stuff
\& GRAVATAR => { default => "http://myhost.moo/local/image.png",
\& size => 80,
\& rating => "R" },
\& );
\& # note the "default" must be an absolute URI to work correctly
\&
\& my $tt2 = Template\->new(\e%config);
\&
\& my $user = { email => \*(Aqwhatever@wherever.whichever\*(Aq,
\& rating => "PG",
\& name => "Manamana",
\& size => 75 };
\&
\& print header(), start_html();
\&
\& $tt2\->process(\e*DATA, { user => $user })
\& or warn $Template::ERROR;
\&
\& print end_html();
\&
\& _\|_DATA_\|_
\& [% USE Gravatar %]
\& [% FILTER html %]
\&
\& [% END %]
.Ve
.SH "Description"
.IX Header "Description"
Please see for more on the
service interface and for information
about Gravatars (globally recognized avatars) in general.
.PP
All of the options supported in Gravatars\*(--default, rating, and
size\*(--can be used here. The gravatar_id is generated from a given
email.
.SH "Interface/Settings"
.IX Header "Interface/Settings"
.SS "new"
.IX Subsection "new"
Not called directly. Called when you \f(CW\*(C`USE\*(C'\fR the plugin. Takes defaults
from the template config hash and mixes them with any per template
defaults. E.g.,
.PP
.Vb 2
\& [% USE Gravatar %]
\& Use config arguments if any.
\&
\& [% USE Gravatar(default => \*(Aqhttp://mysite.moo/local/default\-image.gif\*(Aq) %]
\& Mix config arguments, if any, with new instance arguments.
.Ve
.SS "Arguments"
.IX Subsection "Arguments"
.IP "email (required)" 4
.IX Item "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 \f(CW\*(C`gravatar_id\*(C'\fR.
.IP "default (optional)" 4
.IX Item "default (optional)"
The local (any valid absolute image \s-1URI\s0) image to use if there is no
Gravatar corresponding to the given email.
.IP "size (optional)" 4
.IX Item "size (optional)"
Gravatars are square. Size is 1 through 80 (pixels) and sets the width
and the height.
.IP "rating (optional)" 4
.IX Item "rating (optional)"
G|PG|R|X. The \fBmaximum\fR rating of Gravatar you wish returned. If you
have a family friendly forum, for example, you might set it to \*(L"G.\*(R"
.IP "border (\s-1DEPRECATED\s0)" 4
.IX Item "border (DEPRECATED)"
A hex color, e.g. \s-1FF00FF\s0 or F0F. Gravatar no longer does anything with these so we don't even pass them along. If included they will give a warning.
.IP "base (developer override)" 4
.IX Item "base (developer override)"
This is provided as a courtesy for the one or two developers who might
need it. More below.
.IP "gravatar_id (not allowed)" 4
.IX Item "gravatar_id (not allowed)"
This is \fBnot\fR an option but a generated variable. It is an \s-1MD5\s0 hex
hash of the email address. The reason is it not supported as an
optional variable is it would allow avatar hijacking.
.PP
The only argument that must be given when you call the \f(CW\*(C`Gravatar\*(C'\fR
plugin is the email. Everything else \*(-- rating, default image, border,
and size \*(-- can be set in three different places: the config, the
\&\f(CW\*(C`USE\*(C'\fR call, or the \f(CW\*(C`Gravatar\*(C'\fR call. All three of the following
produce the same Gravatar \s-1URL.\s0
.SS "Settings via config"
.IX Subsection "Settings via config"
Used if the entire \*(L"site\*(R" should rely on one set of defaults.
.PP
.Vb 8
\& use Template;
\& my %config = (
\& GRAVATAR => {
\& default => "http://mysite.moo/img/avatar.png",
\& rating => "PG",
\& size => 80,
\& }
\& );
\&
\& my $template = <<;
\& [% USE Gravatar %]
\& [% Gravatar(email => \*(Aqme@myself.ego\*(Aq) | html %]
\&
\& my $tt2 = Template\->new(\e%config);
\& $tt2\->process(\e$template);
.Ve
.SS "Settings via instance"
.IX Subsection "Settings via instance"
Used if a particular template needs its own defaults.
.PP
.Vb 5
\& use Template;
\& my $template = <<;
\& [% USE Gravatar( rating => "PG",
\& size => 80 ) %]
\& [% Gravatar(email => \*(Aqme@myself.ego\*(Aq) | html %]
\&
\& my $tt2 = Template\->new();
\& $tt2\->process(\e$template);
.Ve
.PP
Any other calls with different emails will share the defaults in this
template.
.SS "Settings in the Gravatar call"
.IX Subsection "Settings in the Gravatar call"
Used for per \s-1URL\s0 control.
.PP
.Vb 7
\& use Template;
\& my $template = <<;
\& [% USE Gravatar %]
\& [% Gravatar(email => \*(Aqme@myself.ego\*(Aq,
\& default => "http://mysite.moo/img/avatar.png",
\& rating => "PG",
\& size => 80 ) | html %]
\&
\& my $tt2 = Template\->new();
\& $tt2\->process(\e$template);
.Ve
.SS "Base \s-1URL \s0(for developers only)"
.IX Subsection "Base URL (for developers only)"
You may also override the base \s-1URL\s0 for retrieving the Gravatars. It's
set to use the service from www.gravatar.com. It can be overridden in
the config or the \f(CW\*(C`USE\*(C'\fR.
.SH "Diagnostics"
.IX Header "Diagnostics"
Email is the only required argument. Croaks without it.
.PP
Rating and size are also validated on each call. Croaks if an
invalid size (like 0 or 100) or rating (like \s-1MA\s0 or \s-1NC\-17\s0).
.SH "Configuration AND ENVIRONMENT"
.IX Header "Configuration AND ENVIRONMENT"
No configuration is necessary. You may use the configuration hash of
your new template to pass default information like the default image
location for those without Gravatars. You can also set it in the \f(CW\*(C`USE\*(C'\fR
call per template if needed.
.SH "Dependencies (see also)"
.IX Header "Dependencies (see also)"
Template, Template::Plugin, Carp, Digest::MD5, and
URI::Escape.
.PP
.SH "Bugs and Limitations"
.IX Header "Bugs and Limitations"
None known. I certainly appreciate bug reports and feedback via
\&\f(CW\*(C`https://github.com/pangyre/p5\-template\-plugin\-gravatar/issues\*(C'\fR.
.SH "Author"
.IX Header "Author"
Ashley Pond V, \f(CW\*(C`\*(C'\fR.
.SH "License"
.IX Header "License"
Copyright 2007\-2014, Ashley Pond V.
.PP
This program is free software; you can redistribute it and modify it
under the same terms as Perl itself.
.PP
See .
.SH "See Also"
.IX Header "See Also"
Gravatar::URL \- standalone Gravatar \s-1URL\s0 generation.
.PP
\- The Gravatar web site.
.PP
\- The Gravatar \s-1URL\s0 implementation guide.