This repository has been archived by the owner on Oct 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2759 from JoshuaRLi/master
New JohnCena Goodie
- Loading branch information
Showing
2 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package DDG::Goodie::JohnCena; | ||
# ABSTRACT: WHO IS CHAMP? A simple instant answer that informs people of who the champ really is. | ||
# See https://duck.co/ia/view/john_cena | ||
|
||
use strict; | ||
use DDG::Goodie; | ||
|
||
triggers start => | ||
"who is champ", | ||
"who's champ", | ||
"wrestler meme", | ||
"wwe meme", | ||
"john cena", | ||
"and his name is"; | ||
|
||
zci answer_type => 'john_cena'; | ||
zci is_cached => 1; | ||
|
||
handle remainder => sub { | ||
|
||
return if $_; | ||
|
||
my $answer = 'JOHN CENA'; | ||
|
||
return $answer, | ||
structured_answer => { | ||
id => 'john_cena', | ||
name => 'Answer', | ||
data => { | ||
title => $answer, | ||
subtitle => 'YOUR TIME IS UP, MY TIME IS NOW' | ||
}, | ||
meta => { | ||
sourceName => 'Wikipedia', | ||
sourceUrl => 'https://en.wikipedia.org/wiki/John_Cena' | ||
}, | ||
templates => { | ||
group => 'text' | ||
} | ||
}; | ||
}; | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env perl | ||
|
||
use strict; | ||
use warnings; | ||
use Test::More; | ||
use DDG::Test::Goodie; | ||
|
||
zci answer_type => "john_cena"; | ||
zci is_cached => 1; | ||
|
||
ddg_goodie_test( | ||
['DDG::Goodie::JohnCena'], | ||
'who is champ' => test_zci( | ||
'JOHN CENA', | ||
structured_answer => { | ||
id => 'john_cena', | ||
name => 'Answer', | ||
data => { | ||
title => 'JOHN CENA', | ||
subtitle => 'YOUR TIME IS UP, MY TIME IS NOW' | ||
}, | ||
meta => { | ||
sourceName => 'Wikipedia', | ||
sourceUrl => 'https://en.wikipedia.org/wiki/John_Cena' | ||
}, | ||
templates => { | ||
group => 'text' | ||
} | ||
} | ||
), | ||
'who champ' => undef, | ||
'famous wrestler' => undef, | ||
); | ||
|
||
done_testing; |