From ce4b2c806c67d0ce2bde25368255339f00937374 Mon Sep 17 00:00:00 2001 From: factormystic Date: Fri, 10 Jul 2009 01:05:03 -0400 Subject: [PATCH] added .down plugin --- bot.py | 4 ++-- plugins/downforeveryoneorjustme.py | 16 ++++++++++++++++ plugins/goonsay.py | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 plugins/downforeveryoneorjustme.py diff --git a/bot.py b/bot.py index 1bcc46b..04d0647 100755 --- a/bot.py +++ b/bot.py @@ -1,8 +1,8 @@ #!/usr/bin/python network = "irc.synirc.net" -nick = "skybot" -channel = "#cobol" +nick = "skybot_debug" +channel = "#test" import sys import os diff --git a/plugins/downforeveryoneorjustme.py b/plugins/downforeveryoneorjustme.py new file mode 100644 index 0000000..662df54 --- /dev/null +++ b/plugins/downforeveryoneorjustme.py @@ -0,0 +1,16 @@ +from lxml import html +from util import hook +import urllib + +@hook.command +def down(inp): + '''.down -- checks http://downforeveryoneorjustme.com to see if the site is down''' + + url = 'http://downforeveryoneorjustme.com/' + urllib.quote(inp.strip(), safe='') + page = html.parse(url) + status = page.xpath("//title")[0].text_content() + + return status + +#local testing +#print down("googlelakj.com") \ No newline at end of file diff --git a/plugins/goonsay.py b/plugins/goonsay.py index 688c6b9..794feaa 100644 --- a/plugins/goonsay.py +++ b/plugins/goonsay.py @@ -1,6 +1,6 @@ from util import hook - +#Scaevolus: factormystic if you commit a re-enabled goonsay I'm going to revoke your commit access #@hook.command def goonsay(bot, input): bot.say(' __________ /')