h/plugins/downforeveryoneorjustme.py

16 lines
427 B
Python
Raw Normal View History

2009-07-10 05:05:03 +00:00
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")