Skip to content

Instantly share code, notes, and snippets.

@andrey-str
Forked from andrix/isup.py
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrey-str/b67ca2c85a5e5f09d468 to your computer and use it in GitHub Desktop.
Save andrey-str/b67ca2c85a5e5f09d468 to your computer and use it in GitHub Desktop.
#!/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