import requests
import re
def get_url_status(urls): # checks status for each url in list urls
for url in urls:
try:
r = requests.get(url)
if r.status_code != 200:
print(url + "\tStatus: " + str(r.status_code))
except Exception as e:
print(url + "\tNA FAILED TO CONNECT\t" + str(e))
return None
data = open("README.md", 'r').read()
def main():
urls = re.findall( r"(https?://[^\s]+)\)", data)
get_url_status(urls)
if __name__ == "__main__":
main()
Keep simple script here for my records