X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=data%2Frbot%2Fplugins%2Fimdb.rb;h=3ca2103572ec3046242bb8cadaafbe73d20e82f1;hb=cb192caad83164924f615cfe43123c4d24103387;hp=60826299648c3ae2fbf241904ddbbb32e12b2e84;hpb=f506b9a3752b20ad045a7c852113f133e0bf382e;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/imdb.rb b/data/rbot/plugins/imdb.rb index 60826299..3ca21035 100644 --- a/data/rbot/plugins/imdb.rb +++ b/data/rbot/plugins/imdb.rb @@ -12,7 +12,7 @@ # License:: MIT license class Imdb - IMDB = "http://www.imdb.com" + IMDB = "https://www.imdb.com" TITLE_OR_NAME_MATCH = /]*)>([^<]*)<\/a>/ TITLE_MATCH = /]*)>([^<]*)<\/a>/ NAME_MATCH = /]*)>([^<]*)<\/a>/ @@ -150,7 +150,7 @@ class Imdb debug title_date # note that the date dash for series is a - (ndash), not a - (minus sign) # also, the second date, if missing, is an no-break space - pre_title, extra, date, junk = title_date.scan(/^(.*)\((.+?\s+)?(\d\d\d\d(?:–(?:\d\d\d\d| )?)?(?:\/[IV]+)?)\)\s*(.+)?$/).first + pre_title, extra, date, junk = title_date.scan(/^(.*)\((.+?\s+)?(\d\d\d\d(?:–(?:\d\d\d\d| )?)?(?:\/[IV]+)?)[^\)]*\)\s*(.+)?$/).first extra.strip! if extra pre_title.strip! title = fix_article(pre_title) @@ -191,8 +191,8 @@ class Imdb end genre = Array.new - resp.body.scan(/([^<]+)<\/a>/) do |gnr| - genre << gnr + resp.body.scan(/([^<]+)<\/a>/) do |gnr| + genre << gnr.first.strip end plot = resp.body.match(DESC_MATCH)[3] rescue nil