diff --git a/README.md b/README.md index a8b0b14f..4909e881 100644 --- a/README.md +++ b/README.md @@ -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) +
+

Public APIs

+ A collective list of free APIs for use in software and web development +
-*A collective list of free APIs for use in software and web development.* +
-A public API for this project can be found [here](https://github.com/davemachado/public-api)! +
+ Status +
+ + Run tests + + + Validate links + +
-For information on contributing to this project, please see the [contributing guide](CONTRIBUTING.md). +
-**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.** +
+ The Project +
+ Contributing Guide • + API for this project • + Issues • + Pull Requests • + License +

+ Currently Active Maintainers +
+ matheusfelipeog • + pawelborkar • + marekdano • + yannbertrand +
+ +
+ +
+ Alternative sites for the project (unofficials) +
+ Free APIs • + Dev Resources • + Public APIs Site +
+ +--- ## Index diff --git a/build/validate_links.py b/build/validate_links.py index eb5dfa30..9bb4405b 100755 --- a/build/validate_links.py +++ b/build/validate_links.py @@ -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: