]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/search.rb
Plugin header boilerplating.
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / search.rb
index a10853bf868ac6ec1e7ca2b7802715e33da872a2..3b7d682684f7a6f3be3dfcd9a3e6f55858c4ded0 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
@@ -74,6 +85,8 @@ class SearchPlugin < Plugin
 
     first_pars = params[:firstpar] || @bot.config['google.first_par']
 
+    return unless first_pars > 0
+
     Utils.get_first_pars urls, first_pars, :http_util => @bot.httputil, :message => m
 
   end