1 class FortunePlugin < Plugin
2 def help(plugin, topic="")
3 "fortune [<module>] => get a (short) fortune, optionally specifying fortune db"
8 m.reply "incorrect usage: " + help(m.plugin)
15 m.reply "incorrect usage: " + help(m.plugin)
19 ["/usr/games/fortune", "/usr/bin/fortune", "/usr/local/bin/fortune"].each {|f|
20 fortune = f if FileTest.executable? f
22 m.reply "fortune not found" unless fortune
23 ret = Utils.safe_exec(fortune, "-n", "255", "-s", db)
24 m.reply ret.gsub(/\t/, " ").split(/\n/).join(" ")
28 plugin = FortunePlugin.new
29 plugin.register("fortune")