summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/lastfm.rb
diff options
context:
space:
mode:
Diffstat (limited to 'data/rbot/plugins/lastfm.rb')
-rw-r--r--data/rbot/plugins/lastfm.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/data/rbot/plugins/lastfm.rb b/data/rbot/plugins/lastfm.rb
index d6a3eeea..8439d350 100644
--- a/data/rbot/plugins/lastfm.rb
+++ b/data/rbot/plugins/lastfm.rb
@@ -245,8 +245,12 @@ class LastFmPlugin < Plugin
year = get_album(artist, albumtxt)[2]
album = "[#{albumtxt}, #{year}] " if year
end
- date = first.elements["date"].attributes["uts"]
- past = Time.at(date.to_i)
+ past = nil
+ date = XPath.first(first, "//date")
+ if date != nil
+ time = date.attributes["uts"]
+ past = Time.at(time.to_i)
+ end
if now == "true"
verb = _("listening")
if @registry.has_key? "#{m.sourcenick}_verb_present"