added .down plugin

This commit is contained in:
factormystic 2009-07-10 01:05:03 -04:00
parent 199c851d2b
commit ce4b2c806c
3 changed files with 19 additions and 3 deletions

4
bot.py
View File

@ -1,8 +1,8 @@
#!/usr/bin/python #!/usr/bin/python
network = "irc.synirc.net" network = "irc.synirc.net"
nick = "skybot" nick = "skybot_debug"
channel = "#cobol" channel = "#test"
import sys import sys
import os import os

View File

@ -0,0 +1,16 @@
from lxml import html
from util import hook
import urllib
@hook.command
def down(inp):
'''.down <url> -- 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")

View File

@ -1,6 +1,6 @@
from util import hook from util import hook
#Scaevolus: factormystic if you commit a re-enabled goonsay I'm going to revoke your commit access
#@hook.command #@hook.command
def goonsay(bot, input): def goonsay(bot, input):
bot.say(' __________ /') bot.say(' __________ /')