Skip to content

Commit 50090c7

Browse files
committed
Filter out stackoverflow links too
1 parent 03a181c commit 50090c7

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

check-links.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
status_codes = [pdfx.downloader.get_status_code(ref.ref) for ref in refs]
1212

1313
broken_links = [(ref.ref, code) for ref, code in zip(refs, status_codes) if code != 200]
14+
# It seems that Twitter and stackoverflow do not respond well to the link checker and throws a 400
15+
broken_links = [b for b in broken_links if not ('twitter.com' in b or 'stackoverflow.com' in b)]
1416

15-
# it seems that Twitter does not respond well to the link checker and throws a 400
16-
if all(['twitter.com' in url for url, _ in broken_links]):
17+
if len(broken_links) == 0:
1718
sys.exit(0)
1819
else:
1920
print('Broken links:', broken_links)

0 commit comments

Comments
 (0)