def info(rawstr)
sr = search(rawstr)
if !sr
- puts "IMDB : search returned NIL"
+ debug "IMDB: search returned NIL"
return nil
end
resp, data = @http.get(sr, "User-Agent" =>
"imdb <string> => search http://www.imdb.org for <string>"
end
- def privmsg(m)
- unless(m.params && m.params.length > 0)
- m.reply "incorrect usage: " + help(m.plugin)
- return
- end
-
+ def imdb(m, params)
+ what = params[:what].to_s
i = Imdb.new(@bot)
- info = i.info(m.params)
+ info = i.info(what)
if !info
- m.reply "Nothing found for #{m.params}"
+ m.reply "Nothing found for #{what}"
return nil
end
m.reply "#{info[1]} : #{info[0]}"
end
plugin = ImdbPlugin.new
-plugin.register("imdb")
+plugin.map "imdb *what"