Browse Source

Improve README.md (#1985)

pull/1990/head
Matheus Felipe 2 years ago
committed by GitHub
parent
commit
fe6d7b602b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 55 additions and 19 deletions
  1. +44
    -5
      README.md
  2. +11
    -14
      build/validate_links.py

+ 44
- 5
README.md View File

@@ -1,12 +1,51 @@
# Public APIs [![Run tests](https://github.com/public-apis/public-apis/workflows/Run%20tests/badge.svg)](https://github.com/public-apis/public-apis/actions?query=workflow%3A%22Run+tests%22) [![Validate links](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)
<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



+ 11
- 14
build/validate_links.py View File

@@ -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…
Cancel
Save