/lib/DDG/Spice/SoundCloud.pm

https://github.com/pardocz/zeroclickinfo-spice · Perl · 28 lines · 21 code · 7 blank · 0 comment · 2 complexity · ef372641958d3057b9fadc26224df422 MD5 · raw file

  1. package DDG::Spice::SoundCloud;
  2. use DDG::Spice;
  3. description "Displays audio from SoundCloud";
  4. name "SoundCloud";
  5. primary_example_queries "soundcloud ray bradbury";
  6. secondary_example_queries "sc the new yorker";
  7. topics "entertainment", "music";
  8. category "entertainment";
  9. code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/SoundCloud.pm";
  10. attribution web => ['http://jordanscales.com', 'Jordan Scales'],
  11. email => ['scalesjordan@gmail.com', 'Jordan Scales'],
  12. github => ['http://github.com/jdan', 'jdan'],
  13. twitter => ['http://twitter.com/jdan', 'jdan'];
  14. spice to => 'http://api.soundcloud.com/tracks.json?client_id={{ENV{DDG_SPICE_SOUNDCLOUD_APIKEY}}}&q=$1&limit=35&callback={{callback}}&filter=streamable';
  15. triggers startend => "sc", "soundcloud", "sound cloud";
  16. handle remainder => sub {
  17. return if $_ eq '';
  18. return $_ if $_;
  19. return;
  20. };
  21. 1;