PageRenderTime 53ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/DDG/Spice/SoundCloud.pm

https://github.com/aembleton/zeroclickinfo-spice
Perl | 30 lines | 23 code | 7 blank | 0 comment | 2 complexity | 58ff4464b049a2afcd05ae53494727ea MD5 | raw file
  1. package DDG::Spice::SoundCloud;
  2. use DDG::Spice;
  3. description "Displays SoundCloud Players";
  4. name "SoundCloud";
  5. primary_example_queries "soundcloud ray bradbury";
  6. secondary_example_queries "sc kavinsky";
  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/prezjordan', 'prezjordan'],
  13. twitter => ['http://twitter.com/prezjordan', '@prezjordan'];
  14. status "enabled";
  15. spice to => 'http://api.soundcloud.com/tracks.json?client_id={{ENV{DDG_SPICE_SOUNDCLOUD_APIKEY}}}&q=$1&limit=5&callback={{callback}}';
  16. spice is_cached => 0;
  17. triggers startend => "sc", "soundcloud", "sound cloud";
  18. handle remainder => sub {
  19. return if $_ eq '';
  20. return $_ if $_;
  21. return;
  22. };
  23. 1;