commit
94343e7891
|
@ -5,12 +5,14 @@ from util import hook, http
|
||||||
|
|
||||||
@hook.command
|
@hook.command
|
||||||
def down(inp):
|
def down(inp):
|
||||||
'''.down <url> -- checks to see if the site is down'''
|
'''.down <url> -- checks to see if the website is down'''
|
||||||
|
|
||||||
if 'http://' not in inp:
|
urlp = urlparse.urlparse(inp, 'http')
|
||||||
inp = 'http://' + inp
|
|
||||||
|
|
||||||
inp = 'http://' + urlparse.urlparse(inp).netloc
|
if urlp.scheme not in ('http', 'https'):
|
||||||
|
return inp + " is not a valid HTTP URL"
|
||||||
|
|
||||||
|
inp = "%s://%s" % (urlp.scheme, urlp.netloc)
|
||||||
|
|
||||||
# http://mail.python.org/pipermail/python-list/2006-December/589854.html
|
# http://mail.python.org/pipermail/python-list/2006-December/589854.html
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue