added .down plugin
This commit is contained in:
parent
199c851d2b
commit
ce4b2c806c
4
bot.py
4
bot.py
|
@ -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
|
||||||
|
|
|
@ -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")
|
|
@ -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(' __________ /')
|
||||||
|
|
Loading…
Reference in New Issue