From 23b75487b51e7bb0850c66e320eda586658aed80 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 5 Apr 2007 07:52:05 +0000 Subject: imdb plugin: imdb.popular and imdb.exact config options to determine which results to display --- data/rbot/plugins/imdb.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/data/rbot/plugins/imdb.rb b/data/rbot/plugins/imdb.rb index 2f44a6b5..3f750793 100644 --- a/data/rbot/plugins/imdb.rb +++ b/data/rbot/plugins/imdb.rb @@ -41,8 +41,8 @@ class Imdb if resp.code == "200" m = [] - m << TITLE_OR_NAME_MATCH.match(resp.body) - if resp.body.match(/\(Exact Matches\)<\/b>/) + m << TITLE_OR_NAME_MATCH.match(resp.body) if @bot.config['imdb.popular'] + if resp.body.match(/\(Exact Matches\)<\/b>/) and @bot.config['imdb.exact'] m << TITLE_OR_NAME_MATCH.match($') end m.compact! @@ -230,6 +230,13 @@ class Imdb end class ImdbPlugin < Plugin + BotConfig.register BotConfigBooleanValue.new('imdb.popular', + :default => true, + :desc => "Display info on popular IMDB entries matching the request closely") + BotConfig.register BotConfigBooleanValue.new('imdb.exact', + :default => true, + :desc => "Display info on IMDB entries matching the request exactly") + def help(plugin, topic="") "imdb => search http://www.imdb.org for " end -- cgit v1.2.3