+ # Find the character played by :who in :movie
+ #
+ def character(m, params)
+ movie = params[:movie].to_s
+ movie_urls = i.search(movie, :type => :title)
+ unless movie_urls
+ m.reply "movie #{who} not found, sorry"
+ return
+ end
+
+ if params[:actor]
+ who = params[:actor].to_s
+ type = :name
+ else
+ who = params[:character].to_s
+ type = :character
+ end
+
+ name_urls = i.search(who, :type => type, :all => true)
+ unless name_urls
+ m.reply "nothing found about #{who}, sorry"
+ return
+ end
+
+ info = i.name_in_movie(name_urls, movie_urls)
+ if info.empty?
+ m.reply "nothing found about #{who} in #{movie}, sorry"
+ else
+ m.reply info.join("\n")
+ end
+ end
+
+ # Report the characters in movie :movie
+ #
+ def characters(m, params)
+ movie = params[:movie].to_s
+
+ urls = i.search(movie, :type => :title)
+ unless urls
+ m.reply "nothing found about #{movie}"
+ end
+
+ end
+