/lib/DDG/Spice/Stocks.pm
https://github.com/pardocz/zeroclickinfo-spice · Perl · 28 lines · 18 code · 6 blank · 4 comment · 1 complexity · 5a3c754b4e8a5ca9ad87bc4b49c10e77 MD5 · raw file
- package DDG::Spice::Stocks;
- use DDG::Spice;
- primary_example_queries "AAPL";
- description "Shows stock quote for a ticker";
- name "Stocks";
- code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/Stocks.pm";
- icon_url "/i/ycharts.com.ico";
- topics "economy_and_finance";
- category "finance";
- # trigger is intentionally very specific, should trigger from internal view/deep triggers.
- # It's only here because I couldn't get the /js/stocks/ location to end up in generated nginx conf
- # unless I had at least some kind of trigger defined.
- triggers start => 'stock quote for', 'stock quote', 'stock price of', 'stock price';
- spice to => 'http://ycharts.com/quotes/$1';
- spice wrap_jsonp_callback => 1;
- spice proxy_cache_valid => "418 1d";
- handle remainder => sub {
- # needs to be uppercase when it goes to charts api:
- return uc $_ if $_;
- return;
- };
- 1;