summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-04-08 18:45:10 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-04-08 18:45:10 +0000
commitb55a8df8f8d3b796991f9770fe27c3452fa471e6 (patch)
tree559afbb7ce9809f80e0c92384c934606e4e9b8ff
parentc1865e7a92766c0c7e24844703a23e673a58e3a9 (diff)
imdb plugin: try to guess what kind of role is requested depending on the prefix used (with/by/from)
-rw-r--r--data/rbot/plugins/imdb.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/data/rbot/plugins/imdb.rb b/data/rbot/plugins/imdb.rb
index 6ee371a9..652d7442 100644
--- a/data/rbot/plugins/imdb.rb
+++ b/data/rbot/plugins/imdb.rb
@@ -437,6 +437,15 @@ class ImdbPlugin < Plugin
who = params[:who].to_s
years = params[:years]
role = params[:role]
+ if not role
+ case params[:prefix].intern
+ when :with
+ role = /actor|actress/
+ when :by
+ role = /director/
+ end
+ end
+ role = nil if role.downcase = 'anything'
name_urls = i.search(who, :type => :name)
unless name_urls