PageRenderTime 80ms CodeModel.GetById 23ms RepoModel.GetById 7ms app.codeStats 0ms

/lib/DDG/Spice/Book.pm

https://github.com/robertbrook/zeroclickinfo-spice
Perl | 25 lines | 17 code | 8 blank | 0 comment | 1 complexity | 2d85d39687b54186d4f640fe0415fb0e MD5 | raw file
  1. package DDG::Spice::Book;
  2. use DDG::Spice;
  3. primary_example_queries "book reviews moonwalking with einstein";
  4. description "Shows critic rating and a sample review of a book from publications like NY Times, NPR, Guardian.";
  5. name "iDreambooks";
  6. code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/Book.pm";
  7. category "reference";
  8. topics "entertainment", "everyday";
  9. spice to => 'http://idreambooks.com/api/books/reviews.json?api_key={{ENV{DDG_SPICE_BOOK_APIKEY}}}&bpq=10&q=$1';
  10. triggers startend => "idreambooks", "book reviews", "book review";
  11. spice wrap_jsonp_callback => 1;
  12. spice is_cached => 1;
  13. handle remainder => sub {
  14. return $_ if $_;
  15. return;
  16. };
  17. 1;