end
def search(rawstr)
- str = URI.escape(rawstr) << ";site=aka"
+ str = URI.escape(rawstr)
+ str << ";site=aka" if @bot.config['imdb.aka']
return do_search(str)
end
m = /<title>([^<]*)<\/title>/.match(resp.body)
return nil if !m
title_date = m[1]
- pre_title, date, extra = title_date.scan(/^(.*)\((\d\d\d\d(?:[IV]+)?)\)\s*(.+)?$/).first
+ pre_title, date, extra = title_date.scan(/^(.*)\((\d\d\d\d(?:\/[IV]+)?)\)\s*(.+)?$/).first
pre_title.strip!
title = fix_article(pre_title)
end
class ImdbPlugin < Plugin
+ BotConfig.register BotConfigBooleanValue.new('imdb.aka',
+ :default => true,
+ :desc => "Look for IMDB matches also in translated titles and other 'also known as' information")
BotConfig.register BotConfigBooleanValue.new('imdb.popular',
:default => true,
:desc => "Display info on popular IMDB entries matching the request closely")