Created
September 26, 2022 13:26
-
-
Save peterbe/a19f45b6fa72be44b42b029e0a072c31 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from collections import Counter | |
paths = [] | |
with open('content/admin/guides.md') as f: | |
record = False | |
for line in f: | |
if line.startswith('includeGuides:'): | |
record = True | |
continue | |
if record: | |
if line.startswith(' - '): | |
paths.append(line.strip()[2:]) | |
else: | |
break | |
from pprint import pprint | |
pprint(paths) | |
counter = Counter() | |
for uri in paths: | |
url = 'http://localhost:4000/en/enterprise-server@3.6' + uri | |
r = requests.get(url, allow_redirects=False) | |
print(r) | |
counter[r.status_code] += 1 | |
for code, count in counter.most_common(): | |
print(code, '\t', count, 'times') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment