diff options
Diffstat (limited to 'data')
-rw-r--r-- | data/rbot/plugins/imdb.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/data/rbot/plugins/imdb.rb b/data/rbot/plugins/imdb.rb index 05333dcc..0f4b8c80 100644 --- a/data/rbot/plugins/imdb.rb +++ b/data/rbot/plugins/imdb.rb @@ -175,9 +175,13 @@ class Imdb end ratings = "no votes" - m = resp.body.match(/Users rated this ([0-9.]+)\/10 \(([0-9,]+) votes\)/m) - if m - ratings = "#{m[1]}/10 (#{m[2]} voters)" + # parse imdb rating value: + if resp.body.match(/itemprop="ratingValue">([^<]+)</) + ratings = "#{$1}/10" + end + # parse imdb rating count: + if resp.body.match(/itemprop="ratingCount">([^<]+)</) + ratings += " (#{$1} voters)" end genre = Array.new |