PageRenderTime 44ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/DDG/Spice/HackerNews.pm

https://github.com/aembleton/zeroclickinfo-spice
Perl | 25 lines | 19 code | 6 blank | 0 comment | 2 complexity | 4f655471435711cb0de24f0e605cddef MD5 | raw file
  1. package DDG::Spice::HackerNews;
  2. use DDG::Spice;
  3. triggers startend => "hn", "hackernews", "hacker news", "news.yc", "news.ycombinator.com", "hn search", "hnsearch", "hacker news search", "hackernews search";
  4. spice to => 'http://api.thriftdb.com/api.hnsearch.com/items/_search?q=$1&limit=50&weights[title]=1.1&weights[text]=0.7&weights[domain]=2.0&weights[username]=0.1&weights[type]=0.0&weights[points]=1.25&boosts[fields][points]=0.15&boosts[fields][num_comments]=0.15&boosts[functions][pow%282,div%28div%28ms%28create_ts,NOW%29,3600000%29,72%29%29]=200.0&callback={{callback}}';
  5. primary_example_queries "hn postgresql";
  6. description "Search the Hacker News database for related stories/comments";
  7. name "HackerNews";
  8. code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/HackerNews.pm";
  9. icon_url "/i/www.hnsearch.com.ico";
  10. topics "programming", "social";
  11. category "forums";
  12. attribution github => ['https://github.com/adman','Adman'],
  13. twitter => ['http://twitter.com/adman_X','adman_X'];
  14. status "enabled";
  15. handle remainder => sub {
  16. return $_ if $_;
  17. return;
  18. };
  19. 1;