Basic Structured Answer added
parent
31f4294ef5
commit
6e4bc8d350
|
@ -11,23 +11,22 @@ zci is_cached => 1;
|
||||||
|
|
||||||
# Build a structured answer that should match the response from the
|
# Build a structured answer that should match the response from the
|
||||||
# Perl file.
|
# Perl file.
|
||||||
|
my $goodie_version = $DDG::GoodieBundle::OpenSourceDuckDuckGo::VERSION // 999;
|
||||||
|
|
||||||
sub build_structured_answer {
|
sub build_structured_answer {
|
||||||
my @test_params = @_;
|
my $color = shift;
|
||||||
|
my $path = "/share/goodie/color_picker_goodie/$goodie_version/";
|
||||||
return 'plain text response',
|
return 'Color Picker',
|
||||||
structured_answer => {
|
structured_answer => {
|
||||||
|
id => 'color_picker_goodie',
|
||||||
|
name => 'Color Picker Goodie',
|
||||||
data => {
|
data => {
|
||||||
title => 'My Instant Answer Title',
|
color => $color,
|
||||||
subtitle => 'My Subtitle',
|
saturation_value_path => "${path}saturation_value_gradient.png",
|
||||||
# image => 'http://website.com/image.png',
|
hue_path => "${path}hue_gradient.png"
|
||||||
},
|
},
|
||||||
|
|
||||||
templates => {
|
templates => {
|
||||||
group => 'text',
|
group => 'text'
|
||||||
# options => {
|
|
||||||
#
|
|
||||||
# }
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -36,7 +35,7 @@ sub build_structured_answer {
|
||||||
sub build_test { test_zci(build_structured_answer(@_)) }
|
sub build_test { test_zci(build_structured_answer(@_)) }
|
||||||
|
|
||||||
ddg_goodie_test(
|
ddg_goodie_test(
|
||||||
[qw( DDG::Goodie::ColorPicker )],
|
[qw( DDG::Goodie::ColorPickerGoodie )],
|
||||||
# At a minimum, be sure to include tests for all:
|
# At a minimum, be sure to include tests for all:
|
||||||
# - primary_example_queries
|
# - primary_example_queries
|
||||||
# - secondary_example_queries
|
# - secondary_example_queries
|
||||||
|
|
Loading…
Reference in New Issue