PageRenderTime 46ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/DDG/Spice/SeatGeek/Sports.pm

http://github.com/duckduckgo/zeroclickinfo-spice
Perl | 19 lines | 11 code | 5 blank | 3 comment | 1 complexity | d0c97b4a1206c568f94354a9550d440e MD5 | raw file
Possible License(s): Apache-2.0
  1. package DDG::Spice::SeatGeek::Sports;
  2. # ABSTRACT: Returns upcoming sport events for a given team/performer.
  3. use DDG::Spice;
  4. triggers startend => 'upcoming matches', 'events', 'event', 'upcoming match', 'matches', 'sports', 'schedule', 'tickets', 'games';
  5. spice to => 'https://api.seatgeek.com/2/events?q=$1&taxonomies.name=sports&per_page=50&callback={{callback}}';
  6. handle remainder_lc => sub {
  7. # Removes spaces from the beginning of the query
  8. $_ =~ s/^\s+//;
  9. # Removes spaces from the end of the query
  10. $_ =~ s/\s+$//;
  11. return $_ if $_;
  12. return;
  13. };
  14. 1