Skip to content

Instantly share code, notes, and snippets.

@zldoty
Forked from ameesters/quick-check.py
Created July 8, 2021 17:02
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save zldoty/ca1b43ec459ed02f2761b859f6427c4f to your computer and use it in GitHub Desktop.
A python script that checks multiple websites status.
#!/usr/bin/env python
import os, time, httplib
from termcolor import colored
SITES = [
"www.meesters-id.nl",
"www.carolsingers.nl",
]
while 1:
for site in SITES:
conn = httplib.HTTPConnection(site, timeout=10)
conn.request("HEAD", "/")
response = conn.getresponse()
if response.status != 200:
print "\a"
response.status = colored(response.status, 'red')
print "{0:30} {1:10} {2:10}".format(site, response.status, response.reason)
conn.close()
time.sleep(2)
os.system("clear")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment