mirror of
https://github.com/public-apis/public-apis.git
synced 2025-06-18 10:41:49 +02:00
Improve README.md (#1985)
This commit is contained in:
commit
fe6d7b602b
2 changed files with 55 additions and 19 deletions
49
README.md
49
README.md
|
@ -1,12 +1,51 @@
|
|||
# Public APIs [](https://github.com/public-apis/public-apis/actions?query=workflow%3A%22Run+tests%22) [](https://github.com/public-apis/public-apis/actions?query=workflow%3A%22Validate+links%22)
|
||||
<div align="center">
|
||||
<h1>Public APIs</h1>
|
||||
<i>A collective list of free APIs for use in software and web development</i>
|
||||
</div>
|
||||
|
||||
*A collective list of free APIs for use in software and web development.*
|
||||
<br />
|
||||
|
||||
A public API for this project can be found [here](https://github.com/davemachado/public-api)!
|
||||
<div align="center">
|
||||
<sup>Status</sup>
|
||||
<br />
|
||||
<a href="https://github.com/public-apis/public-apis/actions?query=workflow%3A%22Run+tests%22">
|
||||
<img alt="Run tests" src="https://github.com/public-apis/public-apis/workflows/Run%20tests/badge.svg" />
|
||||
</a>
|
||||
<a href="https://github.com/public-apis/public-apis/actions?query=workflow%3A%22Validate+links%22">
|
||||
<img alt="Validate links" src="https://github.com/public-apis/public-apis/workflows/Validate%20links/badge.svg?branch=master" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
For information on contributing to this project, please see the [contributing guide](CONTRIBUTING.md).
|
||||
<br />
|
||||
|
||||
**NOTE: A passing build status indicates all listed APIs are available since the last update. A failing build status indicates that 1 or more services may be unavailable at the moment.**
|
||||
<div align="center">
|
||||
<sub>The Project</sub>
|
||||
<br />
|
||||
<a href="CONTRIBUTING.md">Contributing Guide</a> •
|
||||
<a href="https://github.com/davemachado/public-api">API for this project</a> •
|
||||
<a href="https://github.com/public-apis/public-apis/issues">Issues</a> •
|
||||
<a href="https://github.com/public-apis/public-apis/pulls">Pull Requests</a> •
|
||||
<a href="LICENSE">License</a>
|
||||
<br /><br />
|
||||
<sub>Currently Active Maintainers</sub>
|
||||
<br />
|
||||
<a href="https://github.com/matheusfelipeog">matheusfelipeog</a> •
|
||||
<a href="https://github.com/pawelborkar">pawelborkar</a> •
|
||||
<a href="https://github.com/marekdano">marekdano</a> •
|
||||
<a href="https://github.com/yannbertrand">yannbertrand</a>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<div align="center">
|
||||
<sub>Alternative sites for the project (unofficials)</sub>
|
||||
<br />
|
||||
<a href="https://free-apis.github.io">Free APIs</a> •
|
||||
<a href="https://devresourc.es/tools-and-utilities/public-apis">Dev Resources</a> •
|
||||
<a href="https://public-apis-site.vercel.app">Public APIs Site</a>
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## Index
|
||||
|
||||
|
|
|
@ -5,21 +5,22 @@ import re
|
|||
import socket
|
||||
import sys
|
||||
|
||||
ignored_links = [
|
||||
'https://github.com/public-apis/public-apis/actions?query=workflow%3A%22Run+tests%22',
|
||||
'https://github.com/public-apis/public-apis/workflows/Validate%20links/badge.svg?branch=master',
|
||||
'https://github.com/public-apis/public-apis/actions?query=workflow%3A%22Validate+links%22',
|
||||
'https://github.com/davemachado/public-api',
|
||||
]
|
||||
|
||||
def parse_links(filename):
|
||||
"""Returns a list of URLs from text file"""
|
||||
with open(filename) as fp:
|
||||
data = fp.read()
|
||||
with open(filename, mode='r', encoding='utf-8') as fp:
|
||||
readme = fp.read()
|
||||
index_section = readme.find('## Index')
|
||||
content = readme[index_section:]
|
||||
|
||||
raw_links = re.findall(
|
||||
'((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'\".,<>?«»“”‘’]))',
|
||||
data)
|
||||
links = [raw_link[0] for raw_link in raw_links]
|
||||
content)
|
||||
|
||||
links = [
|
||||
str(raw_link[0]).rstrip('/') for raw_link in raw_links
|
||||
]
|
||||
|
||||
return links
|
||||
|
||||
def dup_links(links):
|
||||
|
@ -30,10 +31,6 @@ def dup_links(links):
|
|||
dupes = []
|
||||
|
||||
for link in links:
|
||||
link = link.rstrip('/')
|
||||
if link in ignored_links:
|
||||
continue
|
||||
|
||||
if link not in seen:
|
||||
seen[link] = 1
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue