PageRenderTime 52ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/DDG/Spice/UrbanDictionary.pm

http://github.com/duckduckgo/zeroclickinfo-spice
Perl | 19 lines | 12 code | 6 blank | 1 comment | 1 complexity | 9600ccf7f732ab5cac83a0e0569c68c0 MD5 | raw file
Possible License(s): Apache-2.0
  1. package DDG::Spice::UrbanDictionary;
  2. # ABSTRACT: Give the Urban Dictionary definition of the search query.
  3. use strict;
  4. use DDG::Spice;
  5. spice is_unsafe => 1;
  6. triggers startend => "ud", "urban", "urbandictionary", "urban dictionary";
  7. spice to => 'http://api.urbandictionary.com/v0/define?term=$1&callback={{callback}}';
  8. handle remainder => sub {
  9. my ($term) = @_;
  10. return $term if $term;
  11. return;
  12. };
  13. 1;