zeroclickinfo-goodies/lib/DDG/Goodie/HelpLine.pm

26 lines
713 B
Perl
Raw Normal View History

2013-06-21 13:34:59 -07:00
package DDG::Goodie::HelpLine;
2013-06-21 12:43:57 -07:00
use DDG::Goodie;
triggers any => 'suicide';
zci answer_type => 'helpline';
primary_example_queries 'suicide hotline';
description 'Checks if a query with the word "suicide" was made in the U.S. and returns a 24 hr suicide hotline.';
attribution github => ['https://github.com/conorfl', 'conorfl'],
twitter => '@areuhappylucia';
code_url 'https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/Helpline.pm';
topics 'everyday';
2013-06-21 13:34:59 -07:00
category 'special';
my %helpline = (
'US' => '1-800-273-TALK (8255)',
);
2013-06-21 12:43:57 -07:00
handle remainder => sub {
2013-06-21 13:34:59 -07:00
return "24 Hour Suicide Hotline: $helpline{$loc->country_code}"
if exists $helpline{$loc->country_code};
2013-06-21 12:43:57 -07:00
};
2013-06-21 13:34:59 -07:00
1;