Commit 323a1367 authored by Jordi Riera's avatar Jordi Riera
Browse files

scripts to test ofind dead links in urls provided in binding docstrings.

parent 4c9c58f1
""" script to parse the url of bindings and find if the page exists or not """
import pprint
import re
import os
import requests
__author__ = 'jordiriera'
url_root = ''
reference_line = re.compile(':reference: ({}.*) "'.format(url_root))
def parse(filename):
dead_links = []
with open(filename, 'r') as file_:
for line in file_.readlines():
res =
if res:
if not exists(
return dead_links
def exists(path):
r = requests.head(path)
return r.status_code ==
if __name__ == '__main__':
root = os.path.dirname(os.path.abspath(__file__))
filename = os.path.join(root, 'tweepy', '')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment