]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/lastfm.rb
spell plugin: it's spell.path, not spell.program
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / lastfm.rb
index b2fd7d231060bcce46db712274c525d2d23b5ff5..6482b543067ce63c90a1c8e6d0f3ffeadcd40469 100644 (file)
@@ -28,10 +28,10 @@ class ::LastFmEvent
 
     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
 
@@ -110,7 +110,7 @@ class LastFmPlugin < Plugin
 
     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")
@@ -124,7 +124,7 @@ class LastFmPlugin < Plugin
       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