]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/dict.rb
autorejoin: standard header
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / dict.rb
index edadd3c7cbb877a08ad104af2d8ff66280c46006..c8c35568d1a6d2d2cb805370dbf74453597b1442 100644 (file)
@@ -53,8 +53,8 @@ class DictPlugin < Plugin
 
   def initialize
     super
-    @dmurl = "http://www.demauroparavia.it/"
-    @dmurlrx = %r{http://(?:www\.)?demauroparavia\.it/(\d+)}
+    @dmurl = "http://old.demauroparavia.it/"
+    @dmurlrx = %r{http://(?:www|old\.)?demauroparavia\.it/(\d+)}
     @dmwapurl = "http://wap.demauroparavia.it/index.php?lemma=%s"
     @dmwaplemma = "http://wap.demauroparavia.it/lemma.php?ID=%s"
     @oxurl = "http://www.askoxford.com/concise_oed/%s"
@@ -140,9 +140,9 @@ class DictPlugin < Plugin
         url << "?view=uk"
       end
       h = @bot.httputil.get(url, :max_redir => 5)
-      if h and h.match(%r!<h2>#{word}(?:<sup>1</sup>)?</h2>!)
+      if h and h.match(/<h2>#{word}<\/h2>(.*)Perform/m)
         m.reply("#{word} : #{url}") unless justcheck
-        defn = $'
+        defn = $1
         m.reply("#{Bold}%s#{Bold}: %s" % [word, defn.ircify_html(:nbsp => :space)], :overlong => :truncate)
         return true
       end