Created my first Goodie.
parent
7cfb7db663
commit
f64bd43be7
|
@ -0,0 +1,29 @@
|
|||
package DDG::Goodie::IsAwesome::xinhhuynh;
|
||||
# ABSTRACT: xinhhuynh's first goodie.
|
||||
|
||||
use DDG::Goodie;
|
||||
|
||||
zci answer_type => "is_awesome_xinhhuynh";
|
||||
zci is_cached => 1;
|
||||
|
||||
name "IsAwesome xinhhuynh";
|
||||
description "My first goodie, it lets the world know that xinhhuynh is awesome.";
|
||||
primary_example_queries "duckduckhack xinhhuynh";
|
||||
category "special";
|
||||
topics "special_interest", "geek";
|
||||
code_url "https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/IsAwesome/xinhhuynh.pm";
|
||||
attribution github => ["https://github.com/xinhhuynh", "Xinh Huynh"],
|
||||
twitter => "xinh_huynh";
|
||||
|
||||
triggers start => "duckduckhack xinhhuynh";
|
||||
|
||||
handle remainder => sub {
|
||||
|
||||
# optional - regex guard
|
||||
# return unless qr/^\w+/;
|
||||
|
||||
return if $_;
|
||||
return "xinhhuynh is awesome and has successfully completed the tutorial!"; # Guard against "no answer"
|
||||
};
|
||||
|
||||
1;
|
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More;
|
||||
use DDG::Test::Goodie;
|
||||
|
||||
zci answer_type => "is_awesome_xinhhuynh";
|
||||
zci is_cached => 1;
|
||||
|
||||
ddg_goodie_test(
|
||||
[qw( DDG::Goodie::IsAwesome::xinhhuynh )],
|
||||
'duckduckhack xinhhuynh' => test_zci('xinhhuynh is awesome and has successfully completed the tutorial!'),
|
||||
'duckduckhack xinhhuynh is awesome' => undef,
|
||||
);
|
||||
|
||||
done_testing;
|
Loading…
Reference in New Issue