#!/usr/bin/env python # # A website utility program to check whether a website is # widely available for webizen to view and browse. # # return code 200 means A-OK # anything else returned, not so good ############################################################# author = "YXNjaGVuYmFjaEBnbWFpbC5jb20=" import request import base64 def chkWebsitesNoCerts(websites): # Checking simple websites # no certs and no authentications for ws in websites: r = requests.get(ws) print ws + "\t\t\t" + str(r.status_code) def chkWebsitesCerts(websites): # Change 'verify' to False if your website does # not have a certification issued by a public authority # Checking websites with Certs for ws in websites: r = requests.get(ws, verify=True) print ws + "\t\t\t" + str(r.status_code) def main(): # Examples websites to check if they are up or not up web=['http://www.google.com/', 'http://www.yahoo.com/', 'http://www.dogpile.com/', 'http://www.unc.edu/', 'http://www.vt.edu/', 'http://www.vcu.edu/'] chkWebsitesNoCerts(web) main()