PageRenderTime 152ms CodeModel.GetById 8ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/DDG/Spice/SeatGeek/EventsByVenue.pm

http://github.com/duckduckgo/zeroclickinfo-spice
Perl | 27 lines | 19 code | 6 blank | 2 comment | 1 complexity | f324e368484ed14be2e1f72d5ee0dabd MD5 | raw file
Possible License(s): Apache-2.0
  1. package DDG::Spice::SeatGeek::EventsByVenue;
  2. # ABSTRACT: Returns upcoming concerts at a venue
  3. use strict;
  4. use DDG::Spice;
  5. triggers start =>
  6. 'upcoming concert at',
  7. 'upcoming concerts at',
  8. 'concerts at',
  9. 'live at',
  10. 'live shows at',
  11. 'shows at',
  12. 'gigs at';
  13. spice proxy_cache_valid => "200 304 12h";
  14. spice to => 'https://api.seatgeek.com/2/events?taxonomies.name=concert&per_page=20&venue.slug=$1&callback={{callback}}';
  15. handle remainder_lc => sub {
  16. # Replaces spaces between words with dashes, because the API requires it
  17. $_ =~ s/\s/\-/g;
  18. return $_ if $_;
  19. return;
  20. };
  21. 1;