networktocode / awesome-network-automation

Curated Awesome list about Network Automation
Other
2.33k stars 441 forks source link

Clean up, remove 404 pages, blogs and tools over 2ish years with no t… #107

Closed itdependsnetworks closed 3 years ago

itdependsnetworks commented 3 years ago

Keep simple script here for my records

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()