From 93c89892b9603bda7665e0ae490ad0935da2ba84 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Fri, 6 Apr 2007 23:51:52 +0000 Subject: imdb plugin: some titles with extra info where missed when searching for movies by person+year --- data/rbot/plugins/imdb.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'data') diff --git a/data/rbot/plugins/imdb.rb b/data/rbot/plugins/imdb.rb index e98a05c4..e5f3b7c2 100644 --- a/data/rbot/plugins/imdb.rb +++ b/data/rbot/plugins/imdb.rb @@ -202,7 +202,7 @@ class Imdb if year = opts[:movies_in_year] filmoyear = @bot.httputil.get(IMDB + sr + "filmoyear") if filmoyear - info << filmoyear.scan(/#{TITLE_MATCH} \(#{year}\)[^\]]*\[(.*)\](?:$|\s*<)/) + info << filmoyear.scan(/#{TITLE_MATCH} \(#{year}\)[^\]]*\[(.*)\]([^<]+)?(?:$|\s*<)/) end return info end @@ -276,15 +276,18 @@ class Imdb data = info[1] movies = [] - data.each { |url, pre_title, pre_roles| + data.each { |url, pre_title, pre_roles, extra| title = fix_article(pre_title.ircify_html) - roles = pre_roles.split(/\]\s+\[/).map { |txt| + role_array = pre_roles.split(/\]\s+\[/).map { |txt| if txt.match(/^(.*)\s+\.\.\.\.\s+(.*)$/) "#{$1} (#{$2})" else txt end - }.join(', ') + } + role_array.last << " " + extra.ircify_html if extra + + roles = role_array.join(', ') movies << [roles, title].join(": ") } -- cgit v1.2.3