From 2675d8b13021c1596feea6bbed7150c91e00bc32 Mon Sep 17 00:00:00 2001 From: Harmon Date: Sat, 10 Apr 2021 09:08:47 -0500 Subject: [PATCH] Remove bindings_url_parser.py --- bindings_url_parser.py | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 bindings_url_parser.py diff --git a/bindings_url_parser.py b/bindings_url_parser.py deleted file mode 100644 index b166ed0..0000000 --- a/bindings_url_parser.py +++ /dev/null @@ -1,34 +0,0 @@ -""" script to parse the url of bindings and find if the page exists or not """ - -import os -import pprint -import re -import requests - -__author__ = 'jordiriera' - -url_root = 'https://dev.twitter.com' -reference_line = re.compile(f':reference: ({url_root}.*) "') - - -def parse(filename): - dead_links = [] - with open(filename, 'r') as file_: - for line in file_.readlines(): - res = reference_line.search(line) - if res: - if not exists(res.group(1)): - dead_links.append(res.group(1)) - - return dead_links - - -def exists(path): - r = requests.head(path) - return r.status_code == requests.codes.ok - - -if __name__ == '__main__': - root = os.path.dirname(os.path.abspath(__file__)) - filename = os.path.join(root, 'tweepy', 'api.py') - pprint.pprint(parse(filename)) -- 2.25.1