2014-10-19 08:45:50 -07:00
|
|
|
|
#!/usr/bin/env perl
|
|
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
|
use warnings;
|
2015-12-26 10:22:25 -08:00
|
|
|
|
use utf8;
|
2014-10-19 08:45:50 -07:00
|
|
|
|
use Test::More;
|
|
|
|
|
use DDG::Test::Goodie;
|
2015-02-12 11:06:44 -08:00
|
|
|
|
use URI::Escape;
|
2014-10-19 08:45:50 -07:00
|
|
|
|
|
|
|
|
|
zci answer_type => 'minecraft';
|
|
|
|
|
zci is_cached => 1;
|
|
|
|
|
|
2016-07-19 10:50:54 -07:00
|
|
|
|
my $goodieVersion = $DDG::GoodieBundle::OpenSourceDuckDuckGo::VERSION // 999;
|
|
|
|
|
|
2014-10-19 08:45:50 -07:00
|
|
|
|
ddg_goodie_test(
|
2014-10-21 03:58:44 -07:00
|
|
|
|
[
|
|
|
|
|
'DDG::Goodie::Minecraft'
|
|
|
|
|
],
|
2015-03-13 17:00:44 -07:00
|
|
|
|
|
2014-10-21 03:58:44 -07:00
|
|
|
|
'ladder crafting minecraft' =>
|
|
|
|
|
test_zci(
|
2016-06-18 07:06:05 -07:00
|
|
|
|
'Minecraft Ladder ingredients: 7 Stick.',
|
2015-02-12 11:06:44 -08:00
|
|
|
|
make_structured_answer(
|
|
|
|
|
"Ladder",
|
2016-06-18 07:06:05 -07:00
|
|
|
|
"7 Stick",
|
2015-02-12 11:06:44 -08:00
|
|
|
|
"Used for climbing walls. You can climb either horizontally or vertically. To climb safely, you can sneak while climbing (hold shift).",
|
|
|
|
|
"http://www.minecraftxl.com/images/wiki/recipes/ladder-crafting.png",
|
|
|
|
|
)
|
2014-10-21 03:58:44 -07:00
|
|
|
|
),
|
2015-12-26 10:22:25 -08:00
|
|
|
|
'how to make a ladder crafting minecraft' =>
|
|
|
|
|
test_zci(
|
2016-06-18 07:06:05 -07:00
|
|
|
|
'Minecraft Ladder ingredients: 7 Stick.',
|
2015-12-26 10:22:25 -08:00
|
|
|
|
make_structured_answer(
|
|
|
|
|
"Ladder",
|
2016-06-18 07:06:05 -07:00
|
|
|
|
"7 Stick",
|
2015-12-26 10:22:25 -08:00
|
|
|
|
"Used for climbing walls. You can climb either horizontally or vertically. To climb safely, you can sneak while climbing (hold shift).",
|
|
|
|
|
"http://www.minecraftxl.com/images/wiki/recipes/ladder-crafting.png",
|
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
'crafting table minecraft' =>
|
|
|
|
|
test_zci(
|
2016-06-18 07:06:05 -07:00
|
|
|
|
'Minecraft Crafting Table ingredients: 4 Wood Planks.',
|
2015-12-26 10:22:25 -08:00
|
|
|
|
make_structured_answer(
|
|
|
|
|
"Crafting Table",
|
2016-06-18 07:06:05 -07:00
|
|
|
|
"4 Wood Planks",
|
2015-12-26 10:22:25 -08:00
|
|
|
|
"When placed on the ground, it provides use of the 3×3 crafting grid.",
|
2016-07-19 10:50:54 -07:00
|
|
|
|
"/share/goodie/minecraft/$goodieVersion/images/crafting-table.gif",
|
2016-06-18 07:06:05 -07:00
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
'how do I craft a workbench in minecraft' =>
|
|
|
|
|
test_zci(
|
|
|
|
|
'Minecraft Crafting Table ingredients: 4 Wood Planks.',
|
|
|
|
|
make_structured_answer(
|
|
|
|
|
"Crafting Table",
|
|
|
|
|
"4 Wood Planks",
|
|
|
|
|
"When placed on the ground, it provides use of the 3×3 crafting grid.",
|
2016-07-19 11:06:27 -07:00
|
|
|
|
"/share/goodie/minecraft/$goodieVersion/images/crafting-table.gif",
|
2015-12-26 10:22:25 -08:00
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
'how to make a crafting table minecraft' =>
|
|
|
|
|
test_zci(
|
2016-06-18 07:06:05 -07:00
|
|
|
|
'Minecraft Crafting Table ingredients: 4 Wood Planks.',
|
2015-12-26 10:22:25 -08:00
|
|
|
|
make_structured_answer(
|
|
|
|
|
"Crafting Table",
|
2016-06-18 07:06:05 -07:00
|
|
|
|
"4 Wood Planks",
|
2015-12-26 10:22:25 -08:00
|
|
|
|
"When placed on the ground, it provides use of the 3×3 crafting grid.",
|
2016-07-19 10:50:54 -07:00
|
|
|
|
"/share/goodie/minecraft/$goodieVersion/images/crafting-table.gif",
|
2015-12-26 10:22:25 -08:00
|
|
|
|
)
|
|
|
|
|
),
|
2015-03-13 17:00:44 -07:00
|
|
|
|
|
2014-10-21 03:58:44 -07:00
|
|
|
|
'tnt minecraft' =>
|
|
|
|
|
test_zci(
|
2016-06-18 07:06:05 -07:00
|
|
|
|
'Minecraft TNT ingredients: 5 Gunpowder + 4 Sand.',
|
2015-02-12 11:06:44 -08:00
|
|
|
|
make_structured_answer(
|
|
|
|
|
"TNT",
|
2016-06-18 07:06:05 -07:00
|
|
|
|
"5 Gunpowder + 4 Sand",
|
|
|
|
|
"An explosive block. When activated, it creates an explosion that damages nearby creatures and destroys nearby blocks",
|
2015-02-12 11:06:44 -08:00
|
|
|
|
"http://www.minecraftxl.com/images/wiki/recipes/tnt-crafting.png",
|
|
|
|
|
)
|
2014-10-21 03:58:44 -07:00
|
|
|
|
),
|
2015-03-13 17:00:44 -07:00
|
|
|
|
|
2014-10-21 03:58:44 -07:00
|
|
|
|
'minecraft how to craft a book' =>
|
|
|
|
|
test_zci(
|
2016-06-18 07:06:05 -07:00
|
|
|
|
'Minecraft Book ingredients: 3 Paper + 1 Leather.',
|
2015-02-12 11:06:44 -08:00
|
|
|
|
make_structured_answer(
|
|
|
|
|
"Book",
|
2016-06-18 07:06:05 -07:00
|
|
|
|
"3 Paper + 1 Leather",
|
|
|
|
|
"Used to create book and quills, bookshelfs or an enchantment table. Can be enchanted.",
|
2015-02-12 11:06:44 -08:00
|
|
|
|
"http://www.minecraftxl.com/images/wiki/recipes/book-crafting.png",
|
|
|
|
|
)
|
2014-10-21 03:58:44 -07:00
|
|
|
|
),
|
2015-03-13 17:00:44 -07:00
|
|
|
|
|
2014-10-21 03:58:44 -07:00
|
|
|
|
'minecraft activator rail' =>
|
|
|
|
|
test_zci(
|
2016-06-18 07:06:05 -07:00
|
|
|
|
'Minecraft Activator Rail ingredients: 6 Iron Ingot + 2 Stick + 1 Redstone Torch.',
|
2015-02-12 11:06:44 -08:00
|
|
|
|
make_structured_answer(
|
|
|
|
|
"Activator Rail",
|
2016-06-18 08:31:08 -07:00
|
|
|
|
"6 Iron Ingot + 2 Stick + 1 Redstone Torch",
|
2015-02-12 11:06:44 -08:00
|
|
|
|
"Used to activate TNT Minecarts or Minecarts with Hoppers.",
|
|
|
|
|
"http://www.minecraftxl.com/images/wiki/recipes/activator-rail-crafting.png",
|
|
|
|
|
)
|
2014-10-21 03:58:44 -07:00
|
|
|
|
),
|
2015-03-13 17:00:44 -07:00
|
|
|
|
|
2014-10-21 03:58:44 -07:00
|
|
|
|
'how do i craft an anvil in minecraft' =>
|
|
|
|
|
test_zci(
|
2016-06-18 07:06:05 -07:00
|
|
|
|
'Minecraft Anvil ingredients: 3 Iron Block + 4 Iron Ingot.',
|
2015-02-12 11:06:44 -08:00
|
|
|
|
make_structured_answer(
|
|
|
|
|
"Anvil",
|
2016-06-18 07:06:05 -07:00
|
|
|
|
"3 Iron Block + 4 Iron Ingot",
|
2016-06-24 12:59:14 -07:00
|
|
|
|
"Used to combine enchantments, repair or rename items or blocks. Anvils are affected by gravity. On average, an anvil will survive for 25 uses.",
|
2015-02-12 11:06:44 -08:00
|
|
|
|
"http://www.minecraftxl.com/images/wiki/recipes/anvil-crafting.png",
|
|
|
|
|
)
|
2014-10-21 03:58:44 -07:00
|
|
|
|
),
|
|
|
|
|
|
2016-06-24 12:59:14 -07:00
|
|
|
|
'recipe for a shovel on minecraft' =>
|
2016-06-18 07:06:05 -07:00
|
|
|
|
test_zci(
|
2016-06-18 08:31:08 -07:00
|
|
|
|
'Minecraft Shovel ingredients: 2 Stick + 1 Wood Planks OR 1 Cobblestone OR 1 Iron Ingot OR 1 Gold Ingot OR 1 Diamond.',
|
2016-06-18 07:06:05 -07:00
|
|
|
|
make_structured_answer(
|
|
|
|
|
"Shovel",
|
|
|
|
|
"2 Stick + 1 Wood Planks OR 1 Cobblestone OR 1 Iron Ingot OR 1 Gold Ingot OR 1 Diamond",
|
|
|
|
|
"Used to effectively dig sand, dirt, gravel, snow and clay. Required to dig snowballs.",
|
|
|
|
|
"http://www.minecraftxl.com/images/wiki/recipes/shovels-crafting.gif",
|
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
|
2017-06-14 02:43:45 -07:00
|
|
|
|
'minecraft make colored hard clay' =>
|
|
|
|
|
test_zci(
|
2017-08-23 15:59:04 -07:00
|
|
|
|
'Minecraft Colored Terracotta ingredients: 8 Terracotta + 1 Dye.'
|
2017-06-14 02:43:45 -07:00
|
|
|
|
,
|
|
|
|
|
make_structured_answer(
|
2017-08-23 15:59:04 -07:00
|
|
|
|
"Colored Terracotta",
|
|
|
|
|
"8 Terracotta + 1 Dye",
|
2017-06-14 02:43:45 -07:00
|
|
|
|
"Used as decoration or building material.",
|
2017-08-23 15:59:04 -07:00
|
|
|
|
"/share/goodie/minecraft/999/images/colored-terracotta.gif",
|
2017-06-14 02:43:45 -07:00
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
# Same as last but with british spelling of colour
|
|
|
|
|
'minecraft make coloured hard clay' =>
|
|
|
|
|
test_zci(
|
2017-08-23 15:59:04 -07:00
|
|
|
|
'Minecraft Colored Terracotta ingredients: 8 Terracotta + 1 Dye.'
|
2017-06-14 02:43:45 -07:00
|
|
|
|
,
|
|
|
|
|
make_structured_answer(
|
2017-08-23 15:59:04 -07:00
|
|
|
|
"Colored Terracotta",
|
|
|
|
|
"8 Terracotta + 1 Dye",
|
2017-06-14 02:43:45 -07:00
|
|
|
|
"Used as decoration or building material.",
|
2017-08-23 15:59:04 -07:00
|
|
|
|
"/share/goodie/minecraft/999/images/colored-terracotta.gif",
|
2017-06-14 02:43:45 -07:00
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
|
2016-06-18 07:06:05 -07:00
|
|
|
|
'diamond shovel' => undef,
|
2014-10-21 03:58:44 -07:00
|
|
|
|
'craft ladder' => undef,
|
2015-03-13 17:00:44 -07:00
|
|
|
|
'make tnt' => undef,
|
2014-10-21 03:58:44 -07:00
|
|
|
|
'burger minecraft' => undef,
|
|
|
|
|
'crafting burgers in minecraft' => undef,
|
|
|
|
|
'how do i craft a cheeseburger in minecraft' => undef,
|
2014-11-04 04:28:50 -08:00
|
|
|
|
'minecraft download' => undef,
|
|
|
|
|
'cool texture packs for minecraft' => undef,
|
2015-12-26 08:51:45 -08:00
|
|
|
|
'minecraft cake design' => undef,
|
|
|
|
|
'minecraft cake guide' => undef,
|
2014-10-19 08:45:50 -07:00
|
|
|
|
);
|
|
|
|
|
|
2015-02-12 11:06:44 -08:00
|
|
|
|
sub make_structured_answer {
|
|
|
|
|
my ($name, $ingredients, $description, $image ) = @_;
|
|
|
|
|
my %recipe = (
|
2017-06-14 02:43:45 -07:00
|
|
|
|
name => $name,
|
2015-02-12 11:06:44 -08:00
|
|
|
|
ingredients => $ingredients,
|
|
|
|
|
description => $description,
|
2016-06-24 23:47:53 -07:00
|
|
|
|
image => $image,
|
2016-06-24 23:38:34 -07:00
|
|
|
|
imageTile => 1
|
2015-02-12 11:06:44 -08:00
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
return structured_answer => {
|
|
|
|
|
data => {
|
|
|
|
|
title => $recipe{'name'},
|
|
|
|
|
subtitle => "Ingredients: " . $recipe{'ingredients'},
|
|
|
|
|
description => $recipe{'description'},
|
2016-06-24 23:47:53 -07:00
|
|
|
|
image => $recipe{'image'},
|
2016-06-24 23:38:34 -07:00
|
|
|
|
imageTile => 1
|
2015-03-13 17:00:44 -07:00
|
|
|
|
},
|
|
|
|
|
meta => {
|
2015-06-03 12:53:55 -07:00
|
|
|
|
sourceName => "Minecraft Wiki",
|
2016-07-12 08:43:33 -07:00
|
|
|
|
sourceUrl => 'http://minecraft.gamepedia.com/' . uri_escape( $recipe{'name'} )
|
2015-02-12 11:06:44 -08:00
|
|
|
|
},
|
|
|
|
|
templates => {
|
|
|
|
|
group => 'info',
|
|
|
|
|
options => {
|
|
|
|
|
moreAt => 1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2017-06-14 02:43:45 -07:00
|
|
|
|
done_testing;
|