From b55a8df8f8d3b796991f9770fe27c3452fa471e6 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 8 Apr 2007 18:45:10 +0000 Subject: imdb plugin: try to guess what kind of role is requested depending on the prefix used (with/by/from) --- data/rbot/plugins/imdb.rb | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- cgit v1.2.3