/lib/DDG/Spice/Dictionary/Definition.pm

https://github.com/pardocz/zeroclickinfo-spice · Perl · 36 lines · 29 code · 7 blank · 0 comment · 1 complexity · e6c0a8f6f71e59d644dda40b064d289b MD5 · raw file

  1. package DDG::Spice::Dictionary::Definition;
  2. use DDG::Spice;
  3. description "Get the definition of a word";
  4. name "Dictionary";
  5. primary_example_queries "define inundate";
  6. secondary_example_queries "definition of dictionary";
  7. topics "everyday";
  8. category "reference";
  9. code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/Dictionary/Definition.pm";
  10. attribution web => ['http://duckduckgo.com', 'DuckDuckGo'],
  11. twitter => ['http://twitter.com/duckduckgo', '@duckduckgo'];
  12. spice to => 'http://api.wordnik.com/v4/word.json/$1/definitions?includeRelated=true&includeTags=true&limit=3&api_key={{ENV{DDG_SPICE_WORDNIK_APIKEY}}}&callback={{callback}}';
  13. spice proxy_cache_valid => '200 30d';
  14. triggers startend => (
  15. "define",
  16. "define:",
  17. "definition",
  18. "definition:",
  19. "definition of",
  20. "definition of:",
  21. "meaning",
  22. "meaning of",
  23. "meaning of:",
  24. );
  25. handle remainder => sub {
  26. return lc($_) if $_;
  27. return;
  28. };
  29. 1;