if @artists.length > 10 #more than 10 artists and it floods
diff = @artists.length - 10
- @artist_string = @artists[0..10].join(', ')
+ @artist_string = Bold + @artists[0..10].join(', ') + Bold
@artist_string << _(" and %{n} more...") % {:n => diff}
else
- @artist_string = @artists.join(', ')
+ @artist_string = Bold + @artists.join(', ') + Bold
end
end
_("lastfm set nick <user> => associate your current irc nick with a last.fm user. lastfm set verb <present> <past> => set your preferred now playing verb. default \"listening\" and \"listened\".")
when :who
_("lastfm who [<nick>] => show who <nick> is at last.fm. if <nick> is empty, show who you are at lastfm.")
+ when :compare
+ _("lastfm compare <nick1> <nick2> => show musical taste compatibility between nick1 and nick2.")
else
- _("lastfm [<user>] => show your or <user>'s now playing track at lastfm. np [<user>] => same as 'lastfm'. other topics: events, artist, album, track, now, set, who")
+ _("lastfm [<user>] => show your or <user>'s now playing track at lastfm. np [<user>] => same as 'lastfm'. other topics: events, artist, album, track, now, set, who, compare")
end
end
doc = Document.new xml.body
if xml.class == Net::HTTPInternalServerError
- if doc.root.attributes["status"] == "failed"
+ if doc.root and doc.root.attributes["status"] == "failed"
m.reply doc.root.elements["error"].text
else
m.reply _("Could not retrieve events")
venue = e.elements["venue"].elements["name"].text
city = e.elements["venue"].elements["location"].elements["city"].text
country = e.elements["venue"].elements["location"].elements["country"].text
- h[:location] = Bold + venue + Bold + " #{city}, #{country}"
+ h[:location] = Underline + venue + Underline + " #{Bold + city + Bold}, #{country}"
date = e.elements["startDate"].text.split
h[:date] = Time.utc(date[3].to_i, date[2], date[1].to_i)
h[:desc] = e.elements["description"].text