Skip to content

Commit 60a3f41

Browse files
Initial commit
0 parents  commit 60a3f41

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

README.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# awesome-list [![Awesome Lists](https://srv-cdn.himpfen.io/badges/awesome-lists/awesomelists-flat.svg)](https://github.com/awesomelistsio/awesome)
2+
3+
[![Buy Me A Coffee](https://srv-cdn.himpfen.io/badges/buymeacoffee/buymeacoffee-flat.svg)](https://tinyurl.com/2h9aktmd)   [![Ko-Fi](https://srv-cdn.himpfen.io/badges/kofi/kofi-flat.svg)](https://tinyurl.com/d4xnrptz)   [![PayPal](https://srv-cdn.himpfen.io/badges/paypal/paypal-flat.svg)](https://tinyurl.com/mr22naua)   [![Stripe](https://srv-cdn.himpfen.io/badges/stripe/stripe-flat.svg)](https://tinyurl.com/e8ymxdw3)
4+
5+
> A curated list of resources for
6+
7+
## Contents
8+
9+
- [Section](#section)
10+
- [Another Section](#another-section)
11+
12+
## Section
13+
14+
About this section. Optional. Keep this short and focus on the list.
15+
16+
- [List item](http://example.com)
17+
- [List item](http://example.com)
18+
19+
## Another Section
20+
21+
### Subsection
22+
23+
- [List item](http://example.com)
24+
- [List item](http://example.com)
25+
26+
27+
## Contribute
28+
29+
Contributions are welcome!
30+
31+
## License
32+
33+
[![CC0](https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-sa.svg)](http://creativecommons.org/licenses/by-sa/4.0/)

check_readme_links.py

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# README Link Checker
2+
#
3+
# This script checks the online status of links in a README.md file. It extracts all URLs from the README file
4+
# and sends a HEAD request to each URL to determine if the link is online or not.
5+
#
6+
# python check_readme_links.py path/to/README.md
7+
#
8+
# Author: Brandon Himpfen
9+
# Website: himpfen.xyz
10+
11+
import requests
12+
import re
13+
14+
def check_links(file_path):
15+
with open(file_path, 'r') as readme_file:
16+
contents = readme_file.read()
17+
18+
# Extract all URLs from the README file
19+
urls = re.findall(r'\[.*\]\((http[s]?://.*?)\)', contents)
20+
21+
for url in urls:
22+
try:
23+
response = requests.head(url)
24+
if response.status_code == 200:
25+
print(f"Link {url} is online.")
26+
else:
27+
print(f"Link {url} returned status code {response.status_code}.")
28+
except requests.exceptions.RequestException as e:
29+
print(f"Error occurred while checking link {url}: {str(e)}")
30+
31+
# Provide the path to your README.md file
32+
readme_path = 'path/to/README.md'
33+
check_links(readme_path)

0 commit comments

Comments
 (0)