]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
imdb plugin: try to guess what kind of role is requested depending on the prefix...
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sun, 8 Apr 2007 18:45:10 +0000 (18:45 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sun, 8 Apr 2007 18:45:10 +0000 (18:45 +0000)
data/rbot/plugins/imdb.rb

index 6ee371a9812441dc5eafff995c31f10eb9868901..652d744246c237850f41e49e6d06edaeec5446ad 100644 (file)
@@ -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