From: Giuseppe Bilotta Date: Sun, 8 Apr 2007 18:45:10 +0000 (+0000) Subject: imdb plugin: try to guess what kind of role is requested depending on the prefix... X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=b55a8df8f8d3b796991f9770fe27c3452fa471e6;hp=c1865e7a92766c0c7e24844703a23e673a58e3a9;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git imdb plugin: try to guess what kind of role is requested depending on the prefix used (with/by/from) --- 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