summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/grouphug.rb
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-02-18 14:27:43 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-02-18 14:27:43 +0000
commitedd1cf77be07ae507014574141e920ad23eb164d (patch)
treeff4e21c5ba40f32d0713391c9a04dc90cb2742c2 /data/rbot/plugins/grouphug.rb
parent1dc872c99dccc0c34cb15c4083b7a70d4266d635 (diff)
Plugin header boilerplating.
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.
Diffstat (limited to 'data/rbot/plugins/grouphug.rb')
-rw-r--r--data/rbot/plugins/grouphug.rb16
1 files changed, 9 insertions, 7 deletions
diff --git a/data/rbot/plugins/grouphug.rb b/data/rbot/plugins/grouphug.rb
index 87a7e32c..75093665 100644
--- a/data/rbot/plugins/grouphug.rb
+++ b/data/rbot/plugins/grouphug.rb
@@ -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