PageRenderTime 39ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/DDG/Spice/HackerNews.pm

http://github.com/duckduckgo/zeroclickinfo-spice
Perl | 17 lines | 11 code | 5 blank | 1 comment | 1 complexity | 5bf3807c85738ecb09b50244593390a2 MD5 | raw file
Possible License(s): Apache-2.0
  1. package DDG::Spice::HackerNews;
  2. # ABSTRACT: Search for Hacker News
  3. use strict;
  4. use DDG::Spice;
  5. triggers startend => "hn", "hackernews", "hacker news", "news.yc", "news.ycombinator.com", "hn search", "hnsearch", "hacker news search", "hackernews search";
  6. spice to => 'https://hn.algolia.com/api/v1/search?query=$1&tags=story';
  7. spice wrap_jsonp_callback => 1;
  8. handle remainder => sub {
  9. return $_ if $_;
  10. return;
  11. };
  12. 1;