Skip to content

Instantly share code, notes, and snippets.

@andrix
Created December 2, 2011 16:54
Show Gist options
  • Save andrix/1423960 to your computer and use it in GitHub Desktop.
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
#!/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]
@andrix
Copy link
Author

andrix commented Apr 4, 2013

@fenhl Of Course! Do what you want with it :) It's there because it's useful :)

@manalshaikh
Copy link

May i get a php copy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment