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] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@fenhl Of Course! Do what you want with it :) It's there because it's useful :)