package DDG::Goodie::Unicornify;
# ABSTRACT: Return Gravatar image given an email address
use DDG::Goodie;
use CGI qw/img/;
use Email::Valid;
use Unicornify::URL;
triggers start => 'unicornify';
attribution github => ['https://github.com/flaming-toast', 'flaming-toast'];
handle remainder => sub {
my $link = 'http://unicornify.appspot.com/';
if (Email::Valid->address($_)) {
s/[\s\t]+//g; # strip whitespace from the remainder, we just need the email address.
my $answer = 'This is a unique unicorn for ' . $_ . ':' . "\nLearn more at unicornify.appspot.com";
my $heading = $_ . ' (Unicornify)';
my $html = 'This is a unique unicorn for ' . $_ . ':'
.'
'
.''
. 'Learn more at unicornify.appspot.com';
return $answer, heading => $heading, html => $html;
}
return;
};
zci is_cached => 1;
1;