zeroclickinfo-goodies/lib/DDG/Goodie/ZappBrannigan.pm

19 lines
356 B
Perl
Raw Normal View History

2012-05-29 13:48:03 -07:00
package DDG::Goodie::ZappBrannigan;
use DDG::Goodie;
use YAML qw( LoadFile );
triggers any => "zapp", "brannigan";
zci is_cached => 0;
handle query => sub {
2012-06-19 14:03:10 -07:00
return if $_ !~ m/quotes?/;
2012-05-29 13:48:03 -07:00
my @quotes = share('quotes.txt')->slurp;
my $rand = int(rand(scalar(@quotes)));
2012-05-30 14:44:28 -07:00
my $quote = $quotes[$rand];
chomp $quote;
return $quote;
2012-05-29 13:48:03 -07:00
};
1;