-
-
Save andrey-str/b67ca2c85a5e5f09d468 to your computer and use it in GitHub Desktop.
This file contains hidden or 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] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment