Created my first Goodie
parent
957c4ddda6
commit
45b3318d5d
|
@ -0,0 +1,47 @@
|
|||
package DDG::Goodie::IsAwesome::organiker;
|
||||
# ABSTRACT: Write an abstract here
|
||||
# Start at https://duck.co/duckduckhack/goodie_overview if you are new
|
||||
# to instant answer development
|
||||
|
||||
use DDG::Goodie;
|
||||
|
||||
zci answer_type => "is_awesome_organiker";
|
||||
zci is_cached => 1;
|
||||
|
||||
# Metadata. See https://duck.co/duckduckhack/metadata for help in filling out this section.
|
||||
name "IsAwesome organiker";
|
||||
description "Succinct explanation of what this instant answer does";
|
||||
primary_example_queries "first example query", "second example query";
|
||||
secondary_example_queries "optional -- demonstrate any additional triggers";
|
||||
# Uncomment and complete: https://duck.co/duckduckhack/metadata#category
|
||||
# category "";
|
||||
# Uncomment and complete: https://duck.co/duckduckhack/metadata#topics
|
||||
# topics "";
|
||||
code_url "https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/IsAwesome/organiker.pm";
|
||||
attribution github => ["GitHubAccount", "Friendly Name"],
|
||||
twitter => "twitterhandle";
|
||||
|
||||
# Triggers
|
||||
# triggers any => "triggerWord", "trigger phrase";
|
||||
triggers start => "duckduckhack organiker";
|
||||
|
||||
# Handle statement
|
||||
# handle remainder => sub {
|
||||
|
||||
# # optional - regex guard
|
||||
# # return unless qr/^\w+/;
|
||||
|
||||
# return unless $_; # Guard against "no answer"
|
||||
|
||||
# return $_;
|
||||
# };
|
||||
|
||||
handle remainder => sub {
|
||||
|
||||
return "organiker is awesome and has successfully completed the DuckDuckHack Goodie tutorial!";
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
1;
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More;
|
||||
use DDG::Test::Goodie;
|
||||
|
||||
zci answer_type => "is_awesome_organiker";
|
||||
zci is_cached => 1;
|
||||
|
||||
ddg_goodie_test(
|
||||
[qw(
|
||||
DDG::Goodie::IsAwesome::organiker
|
||||
)],
|
||||
'duckduckhack organiker' => test_zci('organiker is awesome and has successfully completed the DuckDuckHack Goodie tutorial!'),
|
||||
'duckduckhack organiker is awesome' => undef,
|
||||
);
|
||||
|
||||
done_testing;
|
Loading…
Reference in New Issue