diff options
Diffstat (limited to 'data')
-rw-r--r-- | data/rbot/plugins/lastfm.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/data/rbot/plugins/lastfm.rb b/data/rbot/plugins/lastfm.rb index e0fa8a3a..44e2e0b4 100644 --- a/data/rbot/plugins/lastfm.rb +++ b/data/rbot/plugins/lastfm.rb @@ -62,7 +62,10 @@ class LastFmPlugin < Plugin # matches are: # 1. day 2. moth 3. year 4. url_who 5. who 6. url_where 7. where 8. how_many pre_events = page.scan(/<tr class="vevent\s+\w+\s+\S+?-(\d\d)-(\d\d)-(\d\d\d\d)\s*">.*?<a class="url summary" href="(\/event\/\d+)">(.*?)<\/a>.*?<a href="(\/venue\/\d+)">(.*?)<\/a>.*?<td class="attendance">(.*?)<\/td>\s+<\/tr>/m) - debug pre_events.inspect + # debug pre_events.inspect + if pre_events.empty? + m.reply "No events found in #{location}, sorry" + end pre_events.each { |day, month, year, url_who, who, url_where, where, how_many| date = Time.utc(year.to_i, month.to_i, day.to_i) url = LASTFM + url_who @@ -71,7 +74,7 @@ class LastFmPlugin < Plugin attendance = how_many.ircify_html events << LastFmEvent.new(url, date, artist, loc, attendance) } - debug events.inspect + # debug events.inspect events[0..2].each { |event| disp_events << "%s %s @ %s (%s) %s" % [event.date.strftime("%a %b, %d %Y"), event.artist, event.location, event.attendance, event.url] |