commit
92c23a7bac
|
@ -0,0 +1,25 @@
|
|||
package DDG::Goodie::MakeMeASandwich;
|
||||
|
||||
use DDG::Goodie;
|
||||
|
||||
name 'Make Me A Sandwich';
|
||||
source 'http://xkcd.com/149/';
|
||||
description 'Responds in accordance with xkcd #149';
|
||||
primary_example_queries 'make me a sandwich', 'sudo make me a sandwich';
|
||||
category 'special';
|
||||
topics 'geek';
|
||||
code_url 'https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/MakeMeASandwich.pm';
|
||||
attribution twitter => 'mattr555',
|
||||
github => ['https://github.com/mattr555/', 'Matt Ramina'];
|
||||
|
||||
triggers end => 'make me a sandwich';
|
||||
|
||||
handle remainder => sub {
|
||||
return 'Okay.',
|
||||
html => 'Okay. <br><a href="http://xkcd.com/149/">More at xkcd</a>' if $_ eq 'sudo';
|
||||
return 'What? Make it yourself.',
|
||||
html => 'What? Make it yourself. <br><a href="http://xkcd.com/149/">More at xkcd</a>' if $_ eq '';
|
||||
return;
|
||||
};
|
||||
|
||||
1;
|
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More;
|
||||
use DDG::Test::Goodie;
|
||||
|
||||
zci answer_type => 'makemeasandwich';
|
||||
|
||||
ddg_goodie_test(
|
||||
[
|
||||
'DDG::Goodie::MakeMeASandwich'
|
||||
],
|
||||
'make me a sandwich' =>
|
||||
test_zci(
|
||||
'What? Make it yourself.',
|
||||
html => 'What? Make it yourself. <br><a href="http://xkcd.com/149/">More at xkcd</a>'
|
||||
),
|
||||
'sudo make me a sandwich' =>
|
||||
test_zci(
|
||||
'Okay.',
|
||||
html => 'Okay. <br><a href="http://xkcd.com/149/">More at xkcd</a>'
|
||||
),
|
||||
'blahblah make me a sandwich' => undef,
|
||||
'0 make me a sandwich' => undef,
|
||||
);
|
||||
|
||||
done_testing;
|
Loading…
Reference in New Issue