]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/search.rb
imdb plugin: add country and director to movie info
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / search.rb
index becfafc2368eb9717ee87ba60f5eec6d80d11a25..9b9768860ba1b17df978da7717b7308781b1ea48 100644 (file)
@@ -1,7 +1,18 @@
-# vim: set sw=2 et:
+#-- vim:sw=2:et
+#++
 #
-# TODO: use lr=lang_<code> or whatever is most appropriate to let google know
-# it shouldn't use the bot's location to find the preferred language
+# :title: Google and Wikipedia search plugin for rbot
+#
+# Author:: Tom Gilbert (giblet) <tom@linuxbrit.co.uk>
+# Author:: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>
+#
+# Copyright:: (C) 2002-2005 Tom Gilbert
+# Copyright:: (C) 2006 Tom Gilbert, Giuseppe Bilotta
+# Copyright:: (C) 2006-2007 Giuseppe Bilotta
+
+# TODO:: use lr=lang_<code> or whatever is most appropriate to let google know
+#        it shouldn't use the bot's location to find the preferred language
+
 require 'uri'
 
 Net::HTTP.version_1_2
@@ -51,7 +62,8 @@ class SearchPlugin < Plugin
     hits = params[:hits] || @bot.config['google.hits']
 
     begin
-      wml = @bot.httputil.get_cached(url)
+      wml = @bot.httputil.get(url)
+      raise unless wml
     rescue => e
       m.reply "error googling for #{what}"
       return
@@ -76,7 +88,7 @@ class SearchPlugin < Plugin
 
     return unless first_pars > 0
 
-    Utils.get_first_pars urls, first_pars, :http_util => @bot.httputil, :message => m
+    Utils.get_first_pars urls, first_pars, :message => m
 
   end