Skip to content

Commit

Permalink
AUTHORS update.
Browse files Browse the repository at this point in the history
Added two plugins from Robin Kearney <robin@riviera.org.uk>
  • Loading branch information
gilbrit committed Aug 10, 2005
1 parent 61778ca commit 8db3c90
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 2 deletions.
5 changes: 5 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@ o Tom Gilbert (giblet) <tom@linuxbrit.co.uk>

Patch contributors
o Peter Suschlik (pesu) <peter@zilium.de>
o Alexey I. Froloff <raorn@altlinux.ru>
o Ari Pollak <ajp@aripollak.com>
o Rudolf Polzer <atfield-dt@durchnull.de>
o Ren� Nussbaumer <public@killerfox.forkbomb.ch>

Module contributors
o dice.rb - David Dorward (Dorward) <david@david.us-lot.org>
o lart.rb - Michael Brailsford <brailsmt@yahoo.com>
o stats.rb - Michael Brailsford <brailsmt@yahoo.com>
o ri.rb - Michael Brailsford <brailsmt@yahoo.com>
o bash/threat - Robin Kearney <robin@riviera.org.uk>

"Testing" (having fun breaking rbot creatively)
o Paul Duncan (pabs) <pabs@pablotron.org>
Expand Down
10 changes: 10 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
Thu Aug 11 00:04:31 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk>

* Patches from "Alexey I. Froloff" <raorn@altlinux.ru>
* Do not use "/home/#{Etc.getlogin}/" for default home directory, use
"#{Etc.getpwnam(Etc.getlogin).dir}/" instead.
* Do not try to load same plugin from different locations. Added ability
to disable system-wide plugins - create PLUGIN.rb.disabled in user's
plugins directory.
* For example, to disable freshmeat plugin installed in /usr/share/rbot/plugins/freshmeat.rb one can create empty file ~/.rbot/plugins/freshmeat.rb.disabled

Mon Aug 08 23:08:01 BST 2005 Tom Gilbert <tom@linuxbrit.co.uk>

* new markov plugin for random inane chat
Expand Down
2 changes: 2 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
o if searchquote (or similar) has 3 results, roundrobin between them as
asked, don't respond a random one
o freeze/thaw factoids (make them readonly) at higher auth
o respond to insults
o feed back errors from plugins (optional)
Expand Down
56 changes: 56 additions & 0 deletions data/rbot/plugins/bash.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# bash.org xml plugin for rbot
# by Robin Kearney (robin@riviera.org.uk)
#
# its a bit of a quick hack, but it works for us :)
#
require 'rexml/document'
require 'uri/common'

class BashPlugin < Plugin
include REXML
def help(plugin, topic="")
"bash => print a random quote from bash.org, bash quote_id => print that quote id from bash.org, bash latest => print the latest quote from bash.org (currently broken, need to get josh@bash.org to fix the xml)"
end
def privmsg(m)
if m.params && m.params =~ /^([-\d]+)$/
id = $1
bash m, id
elsif(m.params == "latest")
bash m, id
else
bash m
end
end

def bash(m, id=0)

if(id != 0)
xml = @bot.httputil.get URI.parse("http://bash.org/xml/?" + id + "&num=1")
elsif(id == "latest")
xml = @bot.httputil.get URI.parse("http://bash.org/xml/?latest&num=1")
else
xml = @bot.httputil.get URI.parse("http://bash.org/xml/?random&num=1")
end
unless xml
m.reply "bash.org rss parse failed"
return
end
doc = Document.new xml
unless doc
m.reply "bash.org rss parse failed"
return
end
doc.elements.each("*/item") {|e|
if(id != 0)
reply = e.elements["title"].text.gsub(/QDB: /,"") + " " + e.elements["link"].text.gsub(/QDB: /,"") + "\n"
reply = reply + e.elements["description"].text.gsub(/\<br \/\>/, "\n")
else
reply = e.elements["title"].text.gsub(/QDB: /,"") + " " + e.elements["link"].text.gsub(/QDB: /,"") + "\n"
reply = reply + e.elements["description"].text.gsub(/\<br \/\>/, "\n")
end
m.reply reply
}
end
end
plugin = BashPlugin.new
plugin.register("bash")
2 changes: 1 addition & 1 deletion data/rbot/plugins/karma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def karma(m, params)


def help(plugin, topic="")
"karma module: <thing>++/<thing>-- => increase/decrease karma for <thing>, karma for <thing>? => show karma for <thing>, karmastats => show stats. Karma is a community rating system - only in-channel messages can affect karma and you cannot adjust your own."
"karma module: Listens to everyone's chat. <thing>++/<thing>-- => increase/decrease karma for <thing>, karma for <thing>? => show karma for <thing>, karmastats => show stats. Karma is a community rating system - only in-channel messages can affect karma and you cannot adjust your own."
end
def listen(m)
return unless m.kind_of?(PrivMessage) && m.public?
Expand Down
2 changes: 1 addition & 1 deletion data/rbot/plugins/lart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def privmsg(m)
#}}}
#{{{
def help(plugin, topic="")
"Lart: The lart plugin allows you to punish/praise someone in the channel. You can also add new punishments and new praises as well as delete them. For the curious, LART is an acronym for Luser Attitude Readjustment Tool.\nUsage: punish/lart <nick> <reason> -- punishes <nick> for <reason>. The reason is optional.\n praise <nick> <reason> -- praises <nick> for <reason>. The reason is optional.\n mod[lart|punish|praise] [add|remove] -- Add or remove a lart or praise."
"Lart: The lart plugin allows you to punish/praise someone in the channel. You can also add new punishments and new praises as well as delete them. For the curious, LART is an acronym for Luser Attitude Readjustment Tool. Usage: punish/lart <nick> [<reason>] -- punishes <nick> for <reason>. praise <nick> [<reason>] -- praises <nick> for <reason>. [add|rm][lart|punish|praise] -- Add or remove a lart or praise."
end
#}}}
# The following are command handlers {{{
Expand Down
55 changes: 55 additions & 0 deletions data/rbot/plugins/threat.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Security threat level plugin for rbot
# by Robin Kearney (robin@riviera.org.uk)
#
# inspired by elliots fascination with the us
# threat level.
#
# again a dirty hack but it works, just...
#

require 'uri/common'

class ThreatPlugin < Plugin

def help(plugin, topic="")
"threat => prints out the current threat level as reported by http://www.dhs.gov/"
end

def privmsg(m)
color = ""
red = "\x0304" # severe
orange = "\x0307" # high
yellow = "\x0308" # elevated
blue = "\x0312" # guarded
green = "\x0303" # low
black = "\x0301" # default

page = @bot.httputil.get URI.parse("http://www.dhs.gov/dhspublic/")
if page =~ / <img.*dhs\/images\/dhs-advisory-(.*).gif.*/
state = $1
end
case state
when "severe"
color = red
when "high"
color = orange
when "elevated"
color = yellow
when "guarded"
color = blue
when "low"
color = green
else
color = black
end

m.reply color + "Today " + m.sourcenick + " the threat level is " + state.capitalize

return
end

end
plugin = ThreatPlugin.new
plugin.register("threat")


0 comments on commit 8db3c90

Please sign in to comment.