Commit Graph

22 Commits (240961711e98072160e6030607ccb760ab4d4697)

Author SHA1 Message Date
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