working Gravatar plugin
parent
05acccd720
commit
7238b6b1fa
|
@ -0,0 +1,23 @@
|
|||
package DDG::Goodie::Gravatar;
|
||||
# ABSTRACT: Return Gravatar image given an email address
|
||||
|
||||
use CGI qw/img/;
|
||||
use DDG::Goodie;
|
||||
use Email::Valid;
|
||||
use Gravatar::URL;
|
||||
|
||||
triggers start => 'gravatar';
|
||||
|
||||
handle remainder => sub {
|
||||
if(Email::Valid->address($_)){
|
||||
return img({src=>gravatar_url(email => $_, default => "mm")});
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
zci is_cached => 1;
|
||||
|
||||
1;
|
||||
|
||||
|
Loading…
Reference in New Issue