Created
December 2, 2011 16:54
-
-
Save andrix/1423960 to your computer and use it in GitHub Desktop.
isup: simple script that query isup.me and tell you if a site is UP/DOWN
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import re | |
import sys | |
from urllib import urlopen | |
def isup(domain): | |
resp = urlopen("http://www.isup.me/%s" % domain).read() | |
return "%s: %s" % (domain, "UP" if re.search("It's just you.", resp, | |
re.DOTALL) else "DOWN") | |
if __name__ == '__main__': | |
if len(sys.argv) > 1: | |
print "\n".join(isup(d) for d in sys.argv[1:]) | |
else: | |
print "usage: %s domain1 [domain2 .. domainN]" % sys.argv[0] |
@fenhl Of Course! Do what you want with it :) It's there because it's useful :)
May i get a php copy?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a pretty useful script. I have ported it to Python 3 and made a minor improvement. I hope that's okay with you.