From 7ab3595d60d2232b003049686403ee8add8e547d Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 18 Sep 2007 12:06:53 +0000 Subject: dict plugin: echo oxford definitions --- data/rbot/plugins/dict.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'data') diff --git a/data/rbot/plugins/dict.rb b/data/rbot/plugins/dict.rb index 245b48a4..6d35bd65 100644 --- a/data/rbot/plugins/dict.rb +++ b/data/rbot/plugins/dict.rb @@ -111,9 +111,11 @@ class DictPlugin < Plugin if params[:british] url << "?view=uk" end - h = @bot.httputil.head(url, :max_redir => 5) - if h - m.reply("#{word} found: #{url}") unless justcheck + h = @bot.httputil.get(url, :max_redir => 5) + if h and h.match(%r!

#{word}(?:1)?

!) + m.reply("#{word} : #{url}") unless justcheck + defn = $' + m.reply("#{Bold}%s#{Bold}: %s" % [word, defn.ircify_html], :overlong => :truncate) return true end } -- cgit v1.2.3