- 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
- if who.match(/<strong>(.*?)<\/strong>(.+)?/)
- artist = Bold + $1.ircify_html + Bold
- artist << ", " << $2.ircify_html if $2
- else
- debug "who: #{who.inspect}"
- artist = who.ircify_html
- end
- if where.match(/<strong>(.*?)<\/strong>(.+)?/)
- loc = Bold + $1.ircify_html + Bold
- loc << ", " << $2.ircify_html if $2
- else
- debug where.inspect
- loc = where.ircify_html
- end
- attendance = how_many.ircify_html
- events << LastFmEvent.new(url, date, artist, loc, attendance)
- }
- # 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]
- }
- m.reply disp_events.join(' | ')
- else
- m.reply "No events found in #{location}"
- return