working Gravatar plugin

master
Jessica Yu 2012-08-21 15:45:28 -07:00
parent 05acccd720
commit 7238b6b1fa
1 changed files with 23 additions and 0 deletions

View File

@ -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;