PageRenderTime 62ms CodeModel.GetById 27ms RepoModel.GetById 1ms app.codeStats 0ms

/lib/DDG/Spice/LaunchLibrary.pm

https://gitlab.com/phora/zeroclickinfo-spice
Perl | 33 lines | 22 code | 7 blank | 4 comment | 0 complexity | a71c55030761fedd8746f24ed3956799 MD5 | raw file
  1. package DDG::Spice::LaunchLibrary;
  2. # ABSTRACT: List upcoming rocket launches and where to watch them online
  3. use strict;
  4. use DDG::Spice;
  5. spice is_cached => 1;
  6. name "Launch Library";
  7. source "LaunchLibrary.net";
  8. description "List upcoming rocket launches and where to watch them online";
  9. primary_example_queries "upcoming rocket launches", "next space launch", "watch a rocket launch";
  10. secondary_example_queries "upcoming rocket webcast", "next space webcast", "watch a space launch webcast";
  11. category "reference";
  12. topics "geek", "science";
  13. code_url "https://github.com/duckduckgo/zeroclickinfo-spice/blob/master/lib/DDG/Spice/LaunchLibrary.pm";
  14. attribution github => ["globalspin", "Chris Radcliff"],
  15. twitter => "chris_radcliff";
  16. # Version 1.1 of the API allows GET requests.
  17. # Parameters are included in the URL path; "/next/10" shows the next 10 launches
  18. # See launchlibrary.net for the API reference.
  19. spice to => 'http://launchlibrary.net/1.1/launch/next/10';
  20. spice wrap_jsonp_callback => 1;
  21. triggers any => "rocket launches", "rocket launch", "space launches", "space launch";
  22. handle query_lc => sub {
  23. return unless $_ =~ /^(watch|upcoming|next|future)+\s?(a)*\s*(space|rocket)\s?launch(es)*\s?(schedule|webcast)*$/;
  24. return 1;
  25. };
  26. 1;