]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
Plugin header boilerplating.
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sun, 18 Feb 2007 14:27:43 +0000 (14:27 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sun, 18 Feb 2007 14:27:43 +0000 (14:27 +0000)
New plugin.header file provided, to be used as model for the header of new plugins. Many existing plugins have been adjusted to provide the same info the same way. I might have misplaced some information, so please let me know if this is the case.

Also augmented a couple of copyright notices to include the 'rbot development team' alongside Tom Gilbert.

38 files changed:
AUTHORS
ChangeLog
data/rbot/plugins/azgame.rb
data/rbot/plugins/bans.rb
data/rbot/plugins/debugger.rb
data/rbot/plugins/dict.rb
data/rbot/plugins/digg.rb
data/rbot/plugins/forecast.rb
data/rbot/plugins/grouphug.rb
data/rbot/plugins/hl2.rb
data/rbot/plugins/imdb.rb
data/rbot/plugins/iplookup.rb
data/rbot/plugins/karma.rb
data/rbot/plugins/lart.rb
data/rbot/plugins/linkbot.rb
data/rbot/plugins/markov.rb
data/rbot/plugins/nickserv.rb
data/rbot/plugins/plugin.header [new file with mode: 0644]
data/rbot/plugins/quiz.rb
data/rbot/plugins/roshambo.rb
data/rbot/plugins/rss.rb
data/rbot/plugins/salut.rb
data/rbot/plugins/script.rb
data/rbot/plugins/search.rb
data/rbot/plugins/shortenurls.rb
data/rbot/plugins/time.rb
data/rbot/plugins/topic.rb
data/rbot/plugins/weather.rb
data/rbot/plugins/wow.rb
lib/rbot/core/auth.rb
lib/rbot/core/basics.rb
lib/rbot/core/config.rb
lib/rbot/core/remote.rb
lib/rbot/core/utils/extends.rb
lib/rbot/core/utils/httputil.rb
lib/rbot/core/utils/utils.rb
lib/rbot/ircbot.rb
lib/rbot/rfc2812.rb

diff --git a/AUTHORS b/AUTHORS
index 96e09504a7fafeb8dc02d1db5c62b23ca9c6b60c..4ed464d4f7edb60efa884cbc45d3deec70c07db6 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -2,7 +2,7 @@ Main Author
 o Tom Gilbert (giblet) <tom@linuxbrit.co.uk>
 
 Bugbear (heavy-duty framework reworker and backwards-compatibility-breaker)
-o Giuseppe Bilotta (tango_) <giuseppe.bilotta@gmail.com>
+o Giuseppe "Oblomov" Bilotta (tango_) <giuseppe.bilotta@gmail.com>
 
 Patch contributors
 o Peter Suschlik (pesu) <peter@zilium.de>
index 5680f0dfa39ce5e7e32623888535f471f8b6d5ba..fc5beeb4846be503a4983c6a71cb603415cf0754 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-02-18  Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
+
+       * Plugin: Provide a plugin.header file with boilerplate plugin
+       title/author/copyright/license information. Authors of new plugins are
+       encouraged to use it. Many existing plugins have been changed to
+       follow the same spec.
+
 2007-02-15  Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
 
        * Plugin: new unreplied() method to handle PRIVMSGs which have not
index dab112cdffe6f242ffba1a4a58325375ac70a613..a6979830439741ca861fe41e80c49ce0aea7d386 100644 (file)
@@ -1,11 +1,17 @@
-# vim: set et sw=2:\r
-# A-Z Game: guess the word by reducing the interval of allowed ones\r
+#-- vim:sw=2:et\r
+#++\r
+#\r
+# :title: A-Z Game Plugin for rbot\r
+#\r
+# Author:: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>\r
+# Author:: Yaohan Chen <yaohan.chen@gmail.com>: Japanese support\r
 #\r
-# Author: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>\r
-# Author: Yaohan Chen <yaohan.chen@gmail.com>: Japanese support\r
+# Copyright:: (C) 2006 Giuseppe Bilotta\r
+# Copyright:: (C) 2007 GIuseppe Bilotta, Yaohan Chen\r
 #\r
-# (C) 2006 Giuseppe Bilotta\r
-# (C) 2007 Yaohan Chen\r
+# License:: GPL v2\r
+#\r
+# A-Z Game: guess the word by reducing the interval of allowed ones\r
 #\r
 # TODO allow manual addition of words\r
 \r
index dfbe116da89c0ce6815a9117f79a0102f26ad5c8..17281d4cc0b83162924303ee61c3a9c516ee36d6 100644 (file)
@@ -1,10 +1,19 @@
-# BansPlugin v3 for 0.9.11\r
+#-- vim:sw=2:et\r
+#++\r
 #\r
-# Managing kick and bans, automatically removing bans after timeouts, quiet bans, and kickban/quietban based on regexp\r
+# :title: Bans Plugin v3 for rbot 0.9.11 and later\r
 #\r
-# (c) 2006 Marco Gulino <marco@kmobiletools.org>\r
-# (c) 2007 kamu <mr.kamu@gmail.com>\r
-# (c) 2007 Giuseppe Bilotta <giuseppe.bilotta@gmail.com>\r
+# Author:: Marco Gulino <marco@kmobiletools.org>\r
+# Author:: kamu <mr.kamu@gmail.com>\r
+# Author:: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>\r
+#\r
+# Copyright:: (C) 2006 Marco Gulino\r
+# Copyright:: (C) 2007 kamu, Giuseppe Bilotta\r
+#\r
+# License:: GPL V2.\r
+#\r
+# Managing kick and bans, automatically removing bans after timeouts, quiet\r
+# bans, and kickban/quietban based on regexp\r
 #\r
 # v1 -> v2 (kamu's version, never released)\r
 #   * reworked\r
 #\r
 # v2 -> v3 (GB)\r
 #   * remove the 'bans' prefix from most of the commands\r
-#   * (un)quiet has been renamed to (un)silence because 'quiet' was used to tell the bot to keep quiet\r
+#   * (un)quiet has been renamed to (un)silence because 'quiet' was used to\r
+#     tell the bot to keep quiet\r
 #   * both (un)quiet and (un)silence are accepted as actions\r
 #   * use the more descriptive 'onjoin' term for autoactions\r
-#   * convert v1's (0.9.10) :bans and :bansmasks to BadWordActions and WhitelistEntries\r
+#   * convert v1's (0.9.10) :bans and :bansmasks to BadWordActions and\r
+#     WhitelistEntries\r
 #   * enhanced list manipulation facilities\r
 #   * fixed regexp usage in requirements for plugin map\r
 #   * add proper auth management\r
-#\r
-# Licensed under GPL V2.\r
 \r
 OnJoinAction = Struct.new("OnJoinAction", :host, :action, :channel, :reason)\r
 BadWordAction = Struct.new("BadWordAction", :regexp, :action, :channel, :timer, :reason)\r
index 2851d6a9ffd97aa1efbd78a8b847540e95534b78..6eabdfea257c5819b326b87ec5c20e4b5c9d59d1 100644 (file)
@@ -1,7 +1,11 @@
-# Debugging/profiling for rbot
+#-- vim:sw=2:et
+#++
 #
-# (c) 2006 Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
-# Licensed under GPL V2.
+# :title: Debugging/profiling for rbot
+#
+# Author:: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>
+# Copyright:: (C) 2006-2007 Giuseppe Bilotta
+# License:: GPL v2
 
 class DebugPlugin < Plugin
   BotConfig.register BotConfigIntegerValue.new('debug.interval',
index 4e1bb7216dee29d0008032b7fcce23065893fbf5..149233d3b0871a0b39ea0ee00c1088e6859e1821 100644 (file)
@@ -1,16 +1,21 @@
-# vim: set sw=2 et:\r
+#-- vim:sw=2:et\r
+#++\r
 #\r
-# dict plugin: provides a link to the definition of a word in one of the supported\r
+# :title: Dictionary lookup plugin for rbot\r
+#\r
+# Author:: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>\r
+# Copyright:: (C) 2006-2007 Giuseppe Bilotta\r
+# License:: GPL v2\r
+#\r
+# Provides a link to the definition of a word in one of the supported\r
 # dictionaries. Currently available are\r
 #   * the Oxford dictionary for (British) English\r
 #   * the De Mauro/Paravia dictionary for Italian\r
 #   * the Chambers dictionary for English (accepts both US and UK)\r
 #\r
-# other plugins can use this one to check if a given word is valid in italian\r
+# Other plugins can use this one to check if a given word is valid in italian\r
 # or english by using the is_italian?/is_british?/is_english? methods\r
 #\r
-# Author: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>\r
-#\r
 # TODO: cache results and reuse them if get_cached returns a cache copy\r
 \r
 require 'uri'\r
index 8e3aeb4e01e4ed279bd629596dfa6a8cf4608793..43b7c9f5f9a4bbbb65be6d6906dc0ce2bf033de5 100644 (file)
@@ -1,4 +1,4 @@
-# Hacked up slashdot headlines plugin...
+# Hacked up digg headlines plugin...
 
 require 'time'
 require 'rexml/document'
index 63e3127c7140fc81c55807af63cce0b9ee566fa0..d0847b59c9eb879d9b67b7f99a5370e5baa8ddb4 100644 (file)
@@ -1,8 +1,11 @@
+#-- vim:sw=2:et
+#++
 #
-# Forecast plugin for rbot
-# by MrChucho (mrchucho@mrchucho.net)
-# Copyright (C) 2006 Ralph M. Churchill
+# :title: Forecast plugin for rbot
 #
+# Author:: MrChucho (mrchucho@mrchucho.net)
+# Copyright:: (C) 2006 Ralph M. Churchill
+
 require 'soap/wsdlDriver'
 require 'open-uri'
 require 'rexml/document'
index 87a7e32c1895e24c7ac8e173a16619cda2d7a99c..75093665067f7036d237e9f2d77ca01467d3adf0 100644 (file)
@@ -1,9 +1,11 @@
-# Plugin for the Ruby IRC bot (http://linuxbrit.co.uk/rbot/)
-# (c) 2005 Mark Kretschmann <markey@web.de>
-# Licensed under GPL V2.
-
-require "net/http"
-
+#-- vim:sw=2:et
+#++
+#
+# :title: Grouphug Plugin for rbot
+#
+# Author:: Mark Kretschmann <markey@web.de>
+# Copyright:: (C) 2005 Mark Kretschmann
+# License:: GPL v2
 
 class GrouphugPlugin < Plugin
   def help( plugin, topic="" )
@@ -14,7 +16,7 @@ class GrouphugPlugin < Plugin
     path = "random"
     path = "confessions/#{params[:num]}" if params[:num]
     begin
-      data = bot.httputil.get_cached(URI.parse("http://grouphug.us/#{path}"))
+      data = @bot.httputil.get_cached(URI.parse("http://grouphug.us/#{path}"))
 
       reg = Regexp.new( '(<td class="conf-text")(.*?)(<p>)(.*?)(</p>)', Regexp::MULTILINE )
       confession = reg.match( data )[4].ircify_html
index e0623433271617adf805afb742c67dc747e36fef..152afdb943f31c573fafbe2627a0644c83b12eb3 100644 (file)
@@ -1,16 +1,21 @@
-# Plugin for the Ruby IRC bot (http://linuxbrit.co.uk/rbot/)\r
+#-- vim:sw=2:et\r
+#++\r
+#\r
+# :title: Half-Life 2 plugin for rbot\r
+#\r
+# Author:: Ole Christian Rynning <oc@rynning.no>\r
+# Copyright:: (C) 2006 Ole Christian Rynning\r
+# License:: GPL v2\r
 #\r
 # Simple Half-Life 2 (Source Engine) plugin to query online\r
 # servers to see if its online and kicking and how many users.\r
 #\r
 # Added 2 seconds timeout to the response. And sockets are now\r
 # closing properly.\r
-#\r
-# (c) 2006 Ole Christian Rynning <oc@rynning.no>\r
-# Licensed under GPL V2.\r
 \r
 require 'socket'\r
 require 'timeout'\r
+\r
 class HL2Plugin < Plugin\r
 \r
   A2S_INFO = "\xFF\xFF\xFF\xFF\x54\x53\x6F\x75\x72\x63\x65\x20\x45\x6E\x67\x69\x6E\x65\x20\x51\x75\x65\x72\x79\x00"\r
@@ -50,6 +55,7 @@ class HL2Plugin < Plugin
   end\r
 \r
 end\r
+\r
 plugin = HL2Plugin.new\r
 plugin.map 'hl2 :conn_str'\r
 \r
index 48c49dc32d94c297eb13682a3e3d73cad3284b1a..6cbdaf5386728dc09865491d57117872bc9bad39 100644 (file)
@@ -1,6 +1,11 @@
-# IMDB plugin for RubyBot
-# (c) 2005 Arnaud Cornet <arnaud.cornet@gmail.com>
-# Licensed under MIT License.
+#-- vim:sw=2:et
+#++
+#
+# :title: IMDB plugin for rbot
+#
+# Author:: Arnaud Cornet <arnaud.cornet@gmail.com>
+# Copyright:: (C) 2005 Arnaud Cornet
+# License:: MIT license
 
 require 'net/http'
 require 'cgi'
index 9da167b08291e4141354b2b3f693ff5027670978..715595e25ee07686fac757281f69002967b4c197 100644 (file)
-#################################################################\r
-# IP Lookup Plugin\r
-# ----------------------------\r
-# by Chris Gahan (chris@ill-logic.com)\r
-#\r
-# Purpose:\r
-# ------------------\r
-# Lets you lookup the owner and their address for any IP address\r
-# or IRC user.\r
-#\r
-#################################################################\r
-\r
-require 'socket'\r
-require 'resolv'\r
-\r
-#################################################################\r
-## ARIN Whois module...\r
-##\r
-\r
-module ArinWhois\r
-\r
-  class Chunk < Hash\r
-    def customer?\r
-      keys.grep(/^(City|Address|StateProv|(Org|Cust)Name)$/).any?\r
-    end\r
-    \r
-    def network?\r
-      keys.grep(/^(CIDR|NetHandle|Parent)$/).any?\r
-    end\r
-\r
-    def contact?\r
-      keys.grep(/^(R|Org)(Tech|Abuse)(Handle|Name|Phone|Email)$/).any?\r
-    end\r
-    \r
-    def valid?\r
-      customer? or network? or contact?\r
-    end\r
-    \r
-    def owner\r
-      self[keys.grep(/^(Org|Cust)Name$/).first]\r
-    end\r
-    \r
-    def location\r
-      [ self['City'], self['StateProv'], self['Country'] ].compact.join(', ')\r
-    end\r
-    \r
-    def address\r
-      [ self['Address'], location, self['PostalCode'] ].compact.join(', ')\r
-    end\r
-    \r
-  end\r
-\r
-  class ArinWhoisParser\r
-    \r
-    def initialize(data)\r
-      @data = data\r
-    end\r
-    \r
-    def split_array_at(a, &block)\r
-      return a unless a.any?\r
-      a = a.to_a\r
-      \r
-      results = []\r
-      last_cutpoint = 0\r
-      \r
-      a.each_with_index do |el,i|\r
-        if block.call(el)\r
-          unless i == 0\r
-            results << a[last_cutpoint...i]\r
-            last_cutpoint = i\r
-          end\r
-        end\r
-      end\r
-      \r
-      if last_cutpoint < a.size or last_cutpoint == 0\r
-        results << a[last_cutpoint..-1]\r
-      end\r
-      \r
-      results\r
-    end\r
-    \r
-    # Whois output format\r
-    # ------------------------\r
-    # Owner info block:\r
-    #   {Org,Cust}Name\r
-    #   Address\r
-    #   City\r
-    #   StateProv\r
-    #   PostalCode\r
-    #   Country (2-digit)\r
-    #\r
-    # Network Information:\r
-    #   CIDR (69.195.25.0/25)\r
-    #   NetHandle (NET-72-14-192-0-1)\r
-    #   Parent (NET-72-0-0-0-0)\r
-    #\r
-    # Contacts:\r
-    #   ({R,Org}{Tech,Abuse}{Handle,Name,Phone,Email})*\r
-    \r
-    def parse_chunks\r
-      return if @data =~ /^No match found /\r
-      chunks = @data.gsub(/^# ARIN WHOIS database, last updated.+/m, '').scan(/(([^\n]+\n)+\n)/m)\r
-      chunks.map do |chunk|\r
-        result = Chunk.new\r
-        \r
-        chunk[0].scan(/([A-Za-z]+?):(.*)/).each do |tuple|\r
-          tuple[1].strip!\r
-          result[tuple[0]] = tuple[1].empty? ? nil : tuple[1]\r
-        end\r
-        \r
-        result\r
-      end\r
-    end\r
-    \r
-    \r
-    def get_parsed_data\r
-      return unless chunks = parse_chunks\r
-      \r
-      results = split_array_at(parse_chunks) {|chunk|chunk.customer?}\r
-      results.map do |chunks|\r
-        {\r
-          :customer => chunks.select{|x|x.customer?}[0],\r
-          :net      => chunks.select{|x|x.network?}[0],\r
-          :contacts => chunks.select{|x|x.contact?}\r
-        }\r
-      end\r
-    end\r
-    \r
-    # Return a hash with :customer, :net, and :contacts info filled in.\r
-    def get_most_specific_owner\r
-      return unless datas = get_parsed_data\r
-      \r
-      datas_with_bitmasks = datas.map do |data| \r
-        bitmask = data[:net]['CIDR'].split('/')[1].to_i\r
-        [bitmask, data]\r
-      end\r
-      #datas_with_bitmasks.sort.each{|x|puts x[0]}\r
-      winner = datas_with_bitmasks.sort[-1][1]\r
-    end\r
-\r
-  end # of class ArinWhoisParser\r
-\r
-module_function\r
-\r
-  def raw_whois(query_string, host)\r
-    s = TCPsocket.open(host, 43)\r
-    s.write(query_string+"\n")\r
-    ret = s.read\r
-    s.close\r
-    return ret\r
-  end\r
-\r
-  def lookup(ip)\r
-    data = raw_whois("+#{ip}", 'whois.arin.net')\r
-    arin = ArinWhoisParser.new data\r
-    arin.get_most_specific_owner\r
-  end\r
-  \r
-  def lookup_location(ip)\r
-    result = lookup(ip)\r
-    result[:customer].location\r
-  end\r
-  \r
-  def lookup_address(ip)\r
-    result = lookup(ip)\r
-    result[:customer].address\r
-  end\r
-\r
-  def lookup_info(ip)\r
-    if result = lookup(ip)\r
-      "#{result[:net]['CIDR']} => #{result[:customer].owner} (#{result[:customer].address})"\r
-    else\r
-      "Address not found."\r
-    end\r
-  end\r
-\r
-end\r
-\r
-\r
-\r
-#################################################################\r
-## The Plugin\r
-##\r
-\r
-class IPLookupPlugin < Plugin\r
+#################################################################
+# IP Lookup Plugin
+# ----------------------------
+# by Chris Gahan (chris@ill-logic.com)
+#
+# Purpose:
+# ------------------
+# Lets you lookup the owner and their address for any IP address
+# or IRC user.
+#
+#################################################################
+
+require 'socket'
+require 'resolv'
+
+#################################################################
+## ARIN Whois module...
+##
+
+module ArinWhois
+
+  class Chunk < Hash
+    def customer?
+      keys.grep(/^(City|Address|StateProv|(Org|Cust)Name)$/).any?
+    end
+
+    def network?
+      keys.grep(/^(CIDR|NetHandle|Parent)$/).any?
+    end
+
+    def contact?
+      keys.grep(/^(R|Org)(Tech|Abuse)(Handle|Name|Phone|Email)$/).any?
+    end
+
+    def valid?
+      customer? or network? or contact?
+    end
+
+    def owner
+      self[keys.grep(/^(Org|Cust)Name$/).first]
+    end
+
+    def location
+      [ self['City'], self['StateProv'], self['Country'] ].compact.join(', ')
+    end
+
+    def address
+      [ self['Address'], location, self['PostalCode'] ].compact.join(', ')
+    end
+
+  end
+
+  class ArinWhoisParser
+
+    def initialize(data)
+      @data = data
+    end
+
+    def split_array_at(a, &block)
+      return a unless a.any?
+      a = a.to_a
+
+      results = []
+      last_cutpoint = 0
+
+      a.each_with_index do |el,i|
+        if block.call(el)
+          unless i == 0
+            results << a[last_cutpoint...i]
+            last_cutpoint = i
+          end
+        end
+      end
+
+      if last_cutpoint < a.size or last_cutpoint == 0
+        results << a[last_cutpoint..-1]
+      end
+
+      results
+    end
+
+    # Whois output format
+    # ------------------------
+    # Owner info block:
+    #   {Org,Cust}Name
+    #   Address
+    #   City
+    #   StateProv
+    #   PostalCode
+    #   Country (2-digit)
+    #
+    # Network Information:
+    #   CIDR (69.195.25.0/25)
+    #   NetHandle (NET-72-14-192-0-1)
+    #   Parent (NET-72-0-0-0-0)
+    #
+    # Contacts:
+    #   ({R,Org}{Tech,Abuse}{Handle,Name,Phone,Email})*
+
+    def parse_chunks
+      return if @data =~ /^No match found /
+      chunks = @data.gsub(/^# ARIN WHOIS database, last updated.+/m, '').scan(/(([^\n]+\n)+\n)/m)
+      chunks.map do |chunk|
+        result = Chunk.new
+
+        chunk[0].scan(/([A-Za-z]+?):(.*)/).each do |tuple|
+          tuple[1].strip!
+          result[tuple[0]] = tuple[1].empty? ? nil : tuple[1]
+        end
+
+        result
+      end
+    end
+
+
+    def get_parsed_data
+      return unless chunks = parse_chunks
+
+      results = split_array_at(parse_chunks) {|chunk|chunk.customer?}
+      results.map do |chunks|
+        {
+          :customer => chunks.select{|x|x.customer?}[0],
+          :net      => chunks.select{|x|x.network?}[0],
+          :contacts => chunks.select{|x|x.contact?}
+        }
+      end
+    end
+
+    # Return a hash with :customer, :net, and :contacts info filled in.
+    def get_most_specific_owner
+      return unless datas = get_parsed_data
+
+      datas_with_bitmasks = datas.map do |data|
+        bitmask = data[:net]['CIDR'].split('/')[1].to_i
+        [bitmask, data]
+      end
+      #datas_with_bitmasks.sort.each{|x|puts x[0]}
+      winner = datas_with_bitmasks.sort[-1][1]
+    end
+
+  end # of class ArinWhoisParser
+
+module_function
+
+  def raw_whois(query_string, host)
+    s = TCPsocket.open(host, 43)
+    s.write(query_string+"\n")
+    ret = s.read
+    s.close
+    return ret
+  end
+
+  def lookup(ip)
+    data = raw_whois("+#{ip}", 'whois.arin.net')
+    arin = ArinWhoisParser.new data
+    arin.get_most_specific_owner
+  end
+
+  def lookup_location(ip)
+    result = lookup(ip)
+    result[:customer].location
+  end
+
+  def lookup_address(ip)
+    result = lookup(ip)
+    result[:customer].address
+  end
+
+  def lookup_info(ip)
+    if result = lookup(ip)
+      "#{result[:net]['CIDR']} => #{result[:customer].owner} (#{result[:customer].address})"
+    else
+      "Address not found."
+    end
+  end
+
+end
+
+
+
+#################################################################
+## The Plugin
+##
+
+class IPLookupPlugin < Plugin
   def help(plugin, topic="")
     "iplookup [ip address / domain name] => lookup info about the owner of the IP address from the ARIN whois database"
-  end\r
-  \r
-  def iplookup(m, params)\r
-    reply = ""\r
-    if params[:domain]\r
-      begin\r
-        ip = Resolv.getaddress(params[:domain])\r
-        reply += "#{params[:domain]} | "\r
-      rescue => e\r
-        m.reply "#{e.message}"\r
-        return\r
-      end\r
-    else\r
-      ip = params[:ip]\r
-    end\r
-    \r
-    reply += ArinWhois.lookup_info(ip)\r
-    m.reply reply\r
-  end\r
-\r
-  def userip(m, params)\r
-    #users = @channels[m.channel].users\r
-    #m.reply "users = #{users.inspect}"\r
-    #m.reply @bot.sendq("WHO #{params[:user]}")\r
-  end\r
-  \r
-end\r
-\r
+  end
+
+  def iplookup(m, params)
+    reply = ""
+    if params[:domain]
+      begin
+        ip = Resolv.getaddress(params[:domain])
+        reply += "#{params[:domain]} | "
+      rescue => e
+        m.reply "#{e.message}"
+        return
+      end
+    else
+      ip = params[:ip]
+    end
+
+    reply += ArinWhois.lookup_info(ip)
+    m.reply reply
+  end
+
+  def userip(m, params)
+    #users = @channels[m.channel].users
+    #m.reply "users = #{users.inspect}"
+    #m.reply @bot.sendq("WHO #{params[:user]}")
+  end
+
+end
+
 plugin = IPLookupPlugin.new
-plugin.map 'iplookup :ip', :action => 'iplookup', :requirements => {:ip => /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/}\r
-plugin.map 'iplookup :domain', :action => 'iplookup', :requirements => {:domain => /^[a-z0-9\.\-]{4,255}$/i}\r
+plugin.map 'iplookup :ip', :action => 'iplookup', :requirements => {:ip => /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/}
+plugin.map 'iplookup :domain', :action => 'iplookup', :requirements => {:domain => /^[a-z0-9\.\-]{4,255}$/i}
 plugin.map 'userip :user', :action => 'userip', :requirements => {:user => /\w+/}
-\r
-\r
-if __FILE__ == $0\r
-  include ArinWhois\r
-  data = open('whoistest.txt').read\r
-  c = ArinWhoisParser.new data\r
-  puts c.get_parsed_data.inspect\r
-end
\ No newline at end of file
+
+
+if __FILE__ == $0
+  include ArinWhois
+  data = open('whoistest.txt').read
+  c = ArinWhoisParser.new data
+  puts c.get_parsed_data.inspect
+end
index f4716e2bd24c75269e718fc80ec6cabaf8048483..43b3f2dc160f3a761fc48b83e2ba7215b55afaa8 100644 (file)
@@ -82,6 +82,7 @@ class KarmaPlugin < Plugin
     end
   end
 end
+
 plugin = KarmaPlugin.new
 plugin.map 'karmastats', :action => 'stats'
 plugin.map 'karma :key', :defaults => {:key => false}
index 9b627fc5ad836c469a93e1e51e26bd1bb578aad1..103becb18f96493c0594a84785031ec782723229 100644 (file)
@@ -1,24 +1,29 @@
-#  Original Author:
-#               Michael Brailsford  <brailsmt@yahoo.com>
-#               aka brailsmt
-#  Author:      Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>
-#  Purpose:     Provide for humorous larts and praises
-#  Original Copyright:
-#               2002 Michael Brailsford.  All rights reserved.
-#  Copyright:   2006 Giuseppe Bilotta.  All rights reserved.
-#  License:     This plugin is licensed under the BSD license.  The terms of
-#               which follow.
+#-- vim:sw=2:et
+#++
 #
-#  Redistribution and use in source and binary forms, with or without
-#  modification, are permitted provided that the following conditions
-#  are met:
+# :title: lart/praise plugin for rbot
 #
-#  1. Redistributions of source code must retain the above copyright notice,
-#     this list of conditions and the following disclaimer.
+# Author::    Michael Brailsford  <brailsmt@yahoo.com> aka brailsmt
+# Author::    Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>
 #
-#  2. Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution.
+# Copyright:: (C) 2002 Michael Brailsford.  All rights reserved.
+# Copyright:: (C) 2006 Giuseppe Bilotta.  All rights reserved.
+#
+# License::  This plugin is licensed under the BSD license.  The terms of
+#            which follow.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# Purpose::   Provide for humorous larts and praises
 
 class LartPlugin < Plugin
 
index 082cbd8003194dedb32ceb11b2b220ef5ae19c0e..29d7ad1b23cebeadc92e70f2dd23901f3caa7290 100644 (file)
@@ -1,8 +1,11 @@
 #-- vim:sw=2:et
 #++
 #
-# Author: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>
-# Copyright (C) 2006 Giuseppe Bilotta
+# :title: linkbot management for rbot
+#
+# Author:: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>
+# Copyright:: (C) 2006 Giuseppe Bilotta
+# License:: GPL v2
 #
 # Based on an idea by hagabaka (Yaohan Chen <yaohan.chen@gmail.com>)
 #
 #
 # This plugin also shows how to create 'fake' messages from a plugin, letting
 # the bot parse them.
+#
 # TODO a possible enhancement to the Irc framework could be to create 'fake'
 # servers to make this even easier.
+
 class LinkBot < Plugin
   BotConfig.register BotConfigArrayValue.new('linkbot.nicks',
     :default => [],
index c87dc99d479005a139e0cd5619d386f0262eadc7..de33136e7c428cdb71811be7a8f8760495aa941c 100644 (file)
@@ -192,6 +192,7 @@ class MarkovPlugin < Plugin
     random_markov(m, message)
   end
 end
+
 plugin = MarkovPlugin.new
 plugin.map 'markov ignore :action :option', :action => "ignore"
 plugin.map 'markov ignore :action', :action => "ignore"
index 7a9ff0c601f40ca83891f90d407f3199895a1d8c..85270933c794a51439d8bcb1e34bc94341e1b3f6 100644 (file)
@@ -1,6 +1,20 @@
+#-- vim:sw=2:et
+#++
+#
+# :title: Nickserv management 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
+#
 # Automatically lookup nicks in @registry and identify when asked
+#
 # Takes over proper nick if required and nick is registered
-# TODO allow custom IDENTIFY and GHOST names
+
+# TODO:: allow custom IDENTIFY and GHOST names
 
 class NickServPlugin < Plugin
   
diff --git a/data/rbot/plugins/plugin.header b/data/rbot/plugins/plugin.header
new file mode 100644 (file)
index 0000000..539fa92
--- /dev/null
@@ -0,0 +1,11 @@
+#-- vim:sw=2:et
+#++
+#
+# :title: Plugin title
+#
+# Author:: Your Name Goes Here <and.your@email>
+# Copyright:: (C) YYYY Your Name
+# License:: plugin licence
+#
+# More documentation, if needed/wanted
+
index 30691d4e56f30382f20c48d18f0829a37020b83f..7e2c0f83b1c201251e3093798de6fa1a4d900699 100644 (file)
@@ -1,30 +1,30 @@
 #-- vim:sw=2:et
 #++
 #
-# Plugin for the Ruby IRC bot (http://linuxbrit.co.uk/rbot/)
-#
-# A trivia quiz game. Fast paced, featureful and fun.
+# :title: Quiz plugin for rbot
 #
 # Author:: Mark Kretschmann <markey@web.de>
 # Author:: Jocke Andersson <ajocke@gmail.com>
 # Author:: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
 # Author:: Yaohan Chen <yaohan.chen@gmail.com>
 #
-# (c) 2006 Mark Kretschmann, Jocke Andersson, Giuseppe Bilotta
-# (c) 2007 Giuseppe Bilotta, Yaohan Chen
+# Copyright:: (C) 2006 Mark Kretschmann, Jocke Andersson, Giuseppe Bilotta
+# Copyright:: (C) 2007 Giuseppe Bilotta, Yaohan Chen
 #
-# Licensed under GPL V2.
+# License:: GPL v2
+#
+# A trivia quiz game. Fast paced, featureful and fun.
 
-# FIXME interesting fact: in the Quiz class, @registry.has_key? seems to be
-# case insensitive. Although this is all right for us, this leads to rank vs
-# registry mismatches. So we have to make the @rank_table comparisons case
-# insensitive as well. For the moment, redefine everything to downcase before
-# matching the nick.
+# FIXME:: interesting fact: in the Quiz class, @registry.has_key? seems to be
+#         case insensitive. Although this is all right for us, this leads to
+#         rank vs registry mismatches. So we have to make the @rank_table
+#         comparisons case insensitive as well. For the moment, redefine
+#         everything to downcase before matching the nick.
 #
-# TODO define a class for the rank table. We might also need it for scoring in
-# other games.
+# TODO:: define a class for the rank table. We might also need it for scoring
+#        in other games.
 #
-# TODO when Ruby 2.0 gets out, fix the FIXME 2.0 UTF-8 workarounds
+# TODO:: when Ruby 2.0 gets out, fix the FIXME 2.0 UTF-8 workarounds
 
 # Class for storing question/answer pairs
 QuizBundle = Struct.new( "QuizBundle", :question, :answer )
index 74b94a4c60687577aadadd0e1b6405a03931c751..033386986618b338e1ce88ccdb4a905b339261eb 100644 (file)
@@ -1,7 +1,13 @@
 #-- vim:sw=2:et
 #++
+#
+# :title: Roshambo (rock-paper-scissors) plugin for rbot
+#
+# Author:: Hans Fugal
+# Copyright:: (C) 2004 Hans Fugal
+#
 # Play the game of roshambo (rock-paper-scissors)
-# Copyright (C) 2004 Hans Fugal
+#
 # Distributed under the same license as rbot itself
 
 require 'time'
index 6b5e62be8030e2d8cf9ec658b7c5776e720e2a60..caebc3fc6795465671dd3cbd62c547cbbab2f181 100644 (file)
@@ -1,13 +1,18 @@
 #-- vim:sw=2:et\r
 #++\r
 #\r
-# RSS feed plugin for RubyBot\r
-# (c) 2004 Stanislav Karchebny <berkus@madfire.net>\r
-# (c) 2005 Ian Monroe <ian@monroe.nu>\r
-# (c) 2005 Mark Kretschmann <markey@web.de>\r
-# (c) 2006 Giuseppe Bilotta <giuseppe.bilotta@gmail.com>\r
+# :title: RSS feed plugin for rbot\r
 #\r
-# Licensed under MIT License.\r
+# Author:: Stanislav Karchebny <berkus@madfire.net>\r
+# Author:: Ian Monroe <ian@monroe.nu>\r
+# Author:: Mark Kretschmann <markey@web.de>\r
+# Author:: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>\r
+#\r
+# Copyright:: (C) 2004 Stanislav Karchebny\r
+# Copyright:: (C) 2005 Ian Monroe, Mark Kretschmann\r
+# Copyright:: (C) 2006-2007 Giuseppe Bilotta\r
+#\r
+# License:: MIT license\r
 \r
 require 'rss/parser'\r
 require 'rss/1.0'\r
index b0bf67e7769fd47d0cc5ecf80d75bc93161e6383..feff2dd63c9efe880d5acf0b3f2d0129cf143e99 100644 (file)
@@ -1,8 +1,17 @@
-# vim: set sw=2 et:\r
+#-- vim:sw=2:et\r
+#++\r
+#\r
+# :title: Salutations plugin for rbot\r
+#\r
+# Author:: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>\r
+# Copyright:: (C) 2006-2007 Giuseppe Bilotta\r
+# License:: GPL v2\r
+#\r
 # Salutations plugin: respond to salutations\r
-# TODO allow online editing of salutations\r
-# TODO *REMEMBER* to set @changed to true after edit\r
-# TODO or changes won't be saved\r
+#\r
+# TODO:: allow online editing of salutations\r
+#\r
+# TODO:: *REMEMBER* to set @changed to true after edit or changes won't be saved\r
 \r
 class SalutPlugin < Plugin\r
   BotConfig.register BotConfigBooleanValue.new('salut.all_languages',\r
index 3976517f7d873154f248026849ef3813e2f263b8..c091b5864a430baa4fc291016ff888a6cdf1b208 100644 (file)
@@ -1,12 +1,17 @@
-# Plugin for the Ruby IRC bot (http://linuxbrit.co.uk/rbot/)
+#-- vim:sw=2:et
+#++
 #
-# Create mini plugins on IRC.
+# :title: Script plugin for rbot
+#
+# Author:: Mark Kretschmann <markey@web.de>
+# Copyright:: (C) 2006 Mark Kretschmann
+# License:: GPL v2
 #
-# Scripts are little Ruby programs that run in the context of the script plugin. You 
-# can create them directly in an IRC channel, and invoke them just like normal rbot plugins. 
+# Create mini plugins on IRC.
 #
-# (c) 2006 Mark Kretschmann <markey@web.de>
-# Licensed under GPL V2.
+# Scripts are little Ruby programs that run in the context of the script
+# plugin. You can create them directly in an IRC channel, and invoke them just
+# like normal rbot plugins. 
 
 
 Command = Struct.new( "Command", :code, :nick, :created, :channel )
index becfafc2368eb9717ee87ba60f5eec6d80d11a25..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
index 5d8df80a15512c7bec4bb879860f81785db002e7..743cad08e78ca5eebfe76cdc26e4d940f017edf2 100644 (file)
@@ -1,13 +1,15 @@
 #-- vim:sw=2:et
 #++
 #
+# :title: ShortURL plugin for rbot
+#
+# Author:: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
+# Copyright:: (C) 2007 Giuseppe Bilotta
+# License:: GPL v2
+#
 # Plugin to handle ShortURL, merges the funcionality of the old rubyurl and tinyurl plugins
 # Note that it's called ShortenURLs and not ShortURL, to prevent conflicts with
 # the actual ruby package used
-#
-# Author:: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
-# (C) 2007 Giuseppe Bilotta
-# Based on existing rbot plugins, as mentioned above :)
 
 require "shorturl"
 require "uri"
index 9f8b8d7cb05bbd045d40314a843882f7b5517df7..96b101ce68e32f95f6701f42da545afbee5deb48 100644 (file)
@@ -1,6 +1,11 @@
-# Time Zone Plugin for rbot
-# (c) 2006 Ian Monroe <ian@monroe.nu>
-# Licensed under MIT License.
+#-- vim:sw=2:et
+#++
+#
+# :title: Time Zone Plugin for rbot
+#
+# Author:: Ian Monroe <ian@monroe.nu>
+# Copyright:: (C) 2006 Ian Monroe
+# License:: MIT license
 
 require 'tzinfo'
 
index 93058a01e11ddd428ea8b3a7f03b915f04dd72ff..672bf82a1aee0d5d8a894b93d1cfe82864207b8c 100644 (file)
@@ -1,4 +1,12 @@
-# Author: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>
+#-- vim:sw=2:et
+#++
+#
+# :title: Topic manipulation plugin for rbot
+#
+# Author:: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
+# Copyright:: (C) 2006-2007 Giuseppe Bilotta
+# License:: GPL v2
+#
 # Add a bunch of topic manipulation features
 
 class TopicPlugin < Plugin
index 07584d883f7f7a45381ce84630e6b21664f64f75..88194e9067ca5ace3c15c60d23d8c9d4f029a95a 100644 (file)
@@ -1,10 +1,15 @@
-# Weather plugin for rbot
+#-- vim:sw=2:et
+#++
 #
-# NOAA National Weather Service support by MrChucho (mrchucho@mrchucho.net)
-# Copyright (C) 2006 Ralph M. Churchill
+# :title: Weather plugin for rbot
 #
-# Weather Undeground support by Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>
-# Copyright (C) 2006 Giuseppe Bilotta
+# Author:: MrChucho (mrchucho@mrchucho.net): NOAA National Weather Service support
+# Author:: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>
+#
+# Copyright:: (C) 2006 Ralph M. Churchill
+# Copyright:: (C) 2006-2007 Giuseppe Bilotta
+#
+# License:: GPL v2
 
 require 'uri'
 require 'rexml/document'
index 4faadaf4576e520617efc005087a22a26dbd12ae..1106d3ccc7f4028e1d9ee33cd5d53ca4ae54ef66 100644 (file)
@@ -1,10 +1,13 @@
+#-- vim:sw=2:et
+#++
 #
-# World of Warcraft Realm Status plugin for rbot
-# by MrChucho (mrchucho@mrchucho.net)
-# Copyright (C) 2006 Ralph M. Churchill
+# :title: World of Warcraft Realm Status plugin for rbot
 #
-# Requires: insatiable appetite for World of Warcraft
+# Author:: MrChucho (mrchucho@mrchucho.net)
+# Copyright:: (C) 2006 Ralph M. Churchill
 #
+# Requires:: insatiable appetite for World of Warcraft
+
 require 'open-uri'
 require 'rexml/document'
 
index daacdc682b33a574f789a89e688beb2f44f34f45..eee500456c241e135fb919018c572d98bc359cd8 100644 (file)
@@ -1,6 +1,11 @@
 #-- vim:sw=2:et\r
 #++\r
-\r
+#\r
+# :title: rbot auth management from IRC\r
+#\r
+# Author:: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>\r
+# Copyright:: (C) 2006,2007 Giuseppe Bilotta\r
+# License:: GPL v2\r
 \r
 class AuthModule < CoreBotModule\r
 \r
index 5c5bcdee4741c1d25487d32956b953b0190f3002..866f506af49e82ca569192886cd5bdb39321ca97 100644 (file)
@@ -1,6 +1,11 @@
 #-- vim:sw=2:et\r
 #++\r
-\r
+#\r
+# :title: rbot basic management from IRC\r
+#\r
+# Author:: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>\r
+# Copyright:: (C) 2006,2007 Giuseppe Bilotta\r
+# License:: GPL v2\r
 \r
 class BasicsModule < CoreBotModule\r
 \r
@@ -92,11 +97,6 @@ class BasicsModule < CoreBotModule
   # when (/^(botsnack|ciggie)$/i)\r
   #   @bot.say m.replyto, @lang.get("thanks_X") % m.sourcenick if(m.public?)\r
   #   @bot.say m.replyto, @lang.get("thanks") if(m.private?)\r
-  # when (/^(hello|howdy|hola|salut|bonjour|sup|niihau|hey|hi(\W|$)|yo(\W|$)).*/i)\r
-  #   @bot.say m.replyto, @lang.get("hello_X") % m.sourcenick if(m.public?)\r
-  #   @bot.say m.replyto, @lang.get("hello") if(m.private?)\r
-  # when (/^\s*(hello|howdy|hola|salut|bonjour|sup|niihau|hey|hi|yo(\W|$))[\s,-.]+#{Regexp.escape(@bot.nick)}$/i)\r
-  #   @bot.say m.replyto, @lang.get("hello_X") % m.sourcenick\r
   # when (/^#{Regexp.escape(@bot.nick)}!*$/)\r
   #   @bot.say m.replyto, @lang.get("hello_X") % m.sourcenick\r
 \r
index 9ef7ebeef6008bad1ea1239cf9e1de956fce875f..a239e97dfe107ac03abb73f18d6021796d4c6498 100644 (file)
@@ -1,6 +1,11 @@
 #-- vim:sw=2:et\r
 #++\r
-\r
+#\r
+# :title: rbot config management from IRC\r
+#\r
+# Author:: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>\r
+# Copyright:: (C) 2006,2007 Giuseppe Bilotta\r
+# License:: GPL v2\r
 \r
 class ConfigModule < CoreBotModule\r
 \r
@@ -163,7 +168,7 @@ class ConfigModule < CoreBotModule
   #  end\r
 \r
   def bot_version(m, param)\r
-    m.reply  "I'm a v. #{$version} rubybot, (c) Tom Gilbert - http://linuxbrit.co.uk/rbot/"\r
+    m.reply  "I'm a v. #{$version} rubybot, (c) Tom Gilbert and the rbot development team - http://linuxbrit.co.uk/rbot/"\r
   end\r
 \r
   def handle_help(m, params)\r
index 43d883dd8796d5303a614e952cb0fce02c3b05e9..35827d89e81eae58f238c6a3a427ca3812a659be 100644 (file)
@@ -11,7 +11,6 @@
 #
 # TODO find a way to manage session id (logging out, manually and/or
 # automatically)
-#
 
 require 'drb/drb'
 
index 44487e0def1884a293eb64d91be49438dd0682cc..e882148b92f8a4ced7d76c357cdf1b28b39cebd4 100644 (file)
@@ -1,10 +1,19 @@
 #-- vim:sw=2:et
 #++
 #
-# Extensions to standard classes, to be used by the various plugins
+# :title: Standard classes extensions
+#
+# Author:: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>
+# Copyright:: (C) 2006,2007 Giuseppe Bilotta
+# License:: GPL v2
+#
+# This file collects extensions to standard Ruby classes and to some core rbot
+# classes to be used by the various plugins
+#
 # Please note that global symbols have to be prefixed by :: because this plugin
 # will be read into an anonymous module
 
+
 # Extensions to the Array class
 #
 class ::Array
@@ -18,6 +27,7 @@ class ::Array
   end
 end
 
+
 # Extensions to the String class
 #
 # TODO make ircify_html() accept an Hash of options, and make riphtml() just
@@ -66,6 +76,7 @@ class ::String
   end
 end
 
+
 # Extensions to the Regexp class, with some common and/or complex regular
 # expressions.
 #
@@ -139,6 +150,7 @@ class ::Regexp
 
 end
 
+
 module ::Irc
 
 
index 7566aca4e1044b6e22f340f9ac16c55b6d386348..ff2fb6c6c55e9f53f7c5b345c14fbbe653318797 100644 (file)
@@ -1,3 +1,15 @@
+#-- vim:sw=2:et
+#++
+#
+# :title: rbot HTTP provider
+#
+# Author:: Tom Gilbert <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
+
 module ::Irc
 module Utils
 
@@ -6,7 +18,7 @@ require 'net/http'
 begin
   require 'net/https'
 rescue LoadError => e
-  error "Coudln't load 'net/https':  #{e.inspect}"
+  error "Couldn't load 'net/https':  #{e.inspect}"
   error "Secured HTTP connections will fail"
 end
 
index c2b7d7b104fa9e8c1c0e9183390aa5b80e58edc4..ac60735d352273212a8681dc631ed05aca856fb6 100644 (file)
@@ -1,3 +1,17 @@
+#-- vim:sw=2:et
+#++
+#
+# :title: rbot utilities provider
+#
+# Author:: Tom Gilbert <tom@linuxbrit.co.uk>
+# Author:: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>
+#
+# Copyright:: (C) 2002-2006 Tom Gilbert
+# Copyright:: (C) 2007 Giuseppe Bilotta
+#
+# TODO some of these Utils should be rewritten as extensions to the approriate
+# standard Ruby classes and accordingly be moved to extends.rb
+
 require 'net/http'
 require 'uri'
 require 'tempfile'
index a95301dd8aaf712b8c1ff042a2af9d6ea12ac9a2..bd19e6375e3b4021703c3c25a678714b9e083189 100644 (file)
@@ -696,7 +696,7 @@ class IrcBot
     end
     quit if $interrupted > 0
     @socket.emergency_puts "PASS " + @config['server.password'] if @config['server.password']
-    @socket.emergency_puts "NICK #{@config['irc.nick']}\nUSER #{@config['irc.user']} 4 #{@config['server.name']} :Ruby bot. (c) Tom Gilbert"
+    @socket.emergency_puts "NICK #{@config['irc.nick']}\nUSER #{@config['irc.user']} 4 #{@config['server.name']} :Ruby bot. (c) Tom Gilbert and the rbot development team"
     quit if $interrupted > 0
     myself.nick = @config['irc.nick']
     myself.user = @config['irc.user']
index cc7fd7e797e24589faa6e0068723605fd59851a7..4a095dc8dac0b0dc0bfb95d812f702b53fedfd5a 100644 (file)
@@ -836,7 +836,8 @@ module Irc
     #
     # ==server events currently supported:
     #
-    # TODO handle errors ERR_NOSUCHNICK, ERR_NOSUCHCHANNEL, ERR_CANNOTSENDTOCHAN
+    # TODO handle errors ERR_NOSUCHNICK, ERR_NOSUCHCHANNEL
+    # TODO handle errors ERR_CHANOPRIVSNEEDED, ERR_CANNOTSENDTOCHAN
     #
     # welcome::     server welcome message on connect
     # yourhost::    your host details (on connection)