diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-04-05 07:52:05 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-04-05 07:52:05 +0000 |
commit | 23b75487b51e7bb0850c66e320eda586658aed80 (patch) | |
tree | d90ab2fe8e77262cf22e821b28e29b2d284e639a | |
parent | 307013d91ed4231ab8e0128a3a8319ef83dd375a (diff) |
imdb plugin: imdb.popular and imdb.exact config options to determine which results to display
-rw-r--r-- | data/rbot/plugins/imdb.rb | 11 |
1 files 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 <string> => search http://www.imdb.org for <string>" end |