PageRenderTime 56ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/DDG/Spice/UrbanDictionary.pm

https://github.com/aembleton/zeroclickinfo-spice
Perl | 31 lines | 23 code | 7 blank | 1 comment | 1 complexity | 37131eb38aabe91edb69dad175d2c9a4 MD5 | raw file
  1. package DDG::Spice::UrbanDictionary;
  2. # ABSTRACT: Give the Urban Dictionary definition of the search query.
  3. use DDG::Spice;
  4. primary_example_queries "urban dictionary ROTFL";
  5. secondary_example_queries "ud OMG", "ud ASD";
  6. description "Lookup UrbanDictionary definitions";
  7. name "UrbanDictionary";
  8. icon_url "/i/urbandictionary.com.ico";
  9. source "UrbanDictionary";
  10. code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/UrbanDictionary.pm";
  11. topics "geek";
  12. category "language";
  13. attribution github => ['https://github.com/FiloSottile','FiloSottile'],
  14. web => ['http://pytux.it','Filippo Valsorda'],
  15. email => ['filippo.valsorda@gmail.com','Filippo Valsorda'];
  16. spice is_unsafe => 1;
  17. triggers startend => "ud", "urban", "urbandictionary", "urban dictionary";
  18. spice to => 'http://api.urbandictionary.com/v0/define?term=$1&callback={{callback}}';
  19. handle remainder => sub {
  20. my ($term) = @_;
  21. return $term if $term;
  22. return;
  23. };
  24. 1;