Commit Graph

29 Commits (df205e2335748e3ab265dafb820eda0330ca82c7)

Author SHA1 Message Date
NaveenKarippai 8ca89d0961 Update test suite to match modified goodie file
The test suite should be modified to match the modified goodie
file for list template.

* prototype of test cases written

See also: #2840
2016-06-06 16:13:05 +00:00
NaveenKarippai 42f790bcb2 Convert help line goodie to KV list template
It would be a good approach by switching the goodie to use
KV list template (content sub-template). This would improve
the readability of query output to end-user.

* removed unused handlebars template

* switched to use `content` sub-template for KV list

* modified yml data by adding name field

See also: #2840
2016-05-22 16:00:30 +00:00
nkarippai 5e47e0f1a8 Convert goodie to list template
The formatting of HelpLine goodie should be improved
so that multiple numbers (query results) are on
different lines. This can be achieved by using `list`
template.

* use `list` template on HelpLine goodie

* handlebars file added for a simple list view

See also: #2840
2016-05-18 17:11:45 +00:00
Rob Emery f2f1a88649 HelpLine: Switching out to text template 2016-05-16 20:52:13 +01:00
Ben Moon b4031a1fc0 Revert "Fix YAML::XS update issue (temporary)" 2016-02-23 16:20:37 +00:00
Ben Moon 530563137b Fix YAML::XS update issue (temporary)
Fixes an issue that arises with v0.61 of YAML::XS.

Does not change any behavior.
2016-02-21 11:19:43 +00:00
Zach Thompson 07b9def34a Goodbye metadata...mostly 2015-11-11 11:14:02 -07:00
Zach Thompson b8aed43d1e * Convert slurp/Load to LoadFile 2015-05-29 16:18:03 -06:00
Rob Emery 56c5ea4a5e Goodies: Enabling `use strict` on all goodies 2015-02-22 20:09:29 +00:00
Russell Holt fa5a969037 attribution cleanup 2015-01-07 13:37:42 -05:00
Matt Miller fd1c66408d HelpLine: add structured answer.
Also, restructure data sources to make it easier for non-technical
people to contribute.
2014-11-15 21:32:59 +02:00
Matt Miller 68fc7c8dec Set explicit caching everywhere.
This explicity sets the caching behavior for all goodies. Goodies which
did not have caching behavior set in their package have had it added.
Similarly for the tests.

This resulted in a number of changes for caching behavior, mostly
moving towards more frequent caching.

I identified three cases where goodies should not be cached. They are when
the result depends upon:

- some random element,
- the time of day or year (as with relative dates), or
- the location of the requesting user

In all other cases, I presumed that the goodies were sufficiently
deterministic in their output to warrant caching.
2014-09-27 10:35:17 -04:00
Matt Miller 5481cf4ebc Fix minor code layout issues.
Reducing scroll spam from dzil by:

- Providing ABSTRACTs for all packages.
- Leaving VERSION vertical space where necessary.

Addresses #600 plus other annoyances in the process.
2014-08-20 14:45:33 -04:00
David Wilkins c4f20414b0 Add Hong Kong and Singapore helplines 2014-07-01 17:58:12 +08:00
Jag Talon 50db6fd40f HelpLine: Renamed "US" to "U.S." 2014-01-29 15:15:35 -05:00
Jag Talon 8f76070ef6 HelpLine: Add the country in the output. 2014-01-28 10:35:09 -05:00
Jag Talon 9e71728f6e HelpLine: Add "ways to kill myself". 2014-01-27 16:51:13 -05:00
Jag Talon 195deab9e1 HelpLine: Added more suicidey triggers. 2014-01-27 16:42:11 -05:00
Jag Talon 6717b63386 HelpLine: Add "suicide intervention". 2014-01-27 14:21:39 -05:00
Jag Talon eef37433e7 HelpLine: Add "suicide help"; 2014-01-27 14:12:28 -05:00
Jag Talon b13ad5adee HelpLine: Have similar number formatting for both kids and regular. 2014-01-27 13:45:24 -05:00
Jag Talon ec35165cd0 HelpLine: Added more triggers.
Thanks to @zekiel and @moollaza.
2014-01-27 13:43:59 -05:00
Jag Talon 545e2c44c0 Helpline: Fix tests. 2014-01-24 00:21:43 -05:00
Jag Talon 0eb758d901 HelpLine: Add the sources of the suicide numbers.
I also limited the triggering to exact matches because it's really hard to distinguish between non-suicide queries ('suicide girls', 'suicide silence', 'suicide is painless', etc.) and suicide queries. The plan is to just build on the list of suicide-y queries as we go along.
2014-01-23 17:13:20 -05:00
brabo 452feeb273 added BE suicide hotline 2013-08-31 01:28:41 +02:00
Dylan Lloyd 48297fc42e added international help lines & updated tests
for country in `perl ../zeroclickinfo-spice/lib/DDG/Spice/Zipcode.pm`;
    do curl "http://www.befrienders.org/directory?country=$country" 2>/dev/null
        | tee tmp
        | egrep 'There are <strong>[1-9]\d* helplines' >/dev/null
            || continue;
        foo="`
            sed -nr 's/.*Helpline 1:<\/strong>\s+([-()0-9 ]+[0-9]).*/\1/p' tmp
                | head -n1`";
        [[ ! -z "$foo" ]]
            && perl -e "print uc \"$country\", ' => \'', \"$foo',\n\"";
done;
2013-06-26 16:05:18 -04:00
Dylan Lloyd 71e012ce13 added triggers and skip list to HelpLine 2013-06-24 14:33:36 -04:00
Dylan Lloyd 485787b6fe refactor HelpLine for easy expansion 2013-06-21 16:34:59 -04:00
Dylan Lloyd 1ee565fd84 rename Helpline HelpLine 2013-06-21 16:34:32 -04:00