checkdeadlinks: Also check for images sources, and check each unique URL only once.

This commit is contained in:
Emmanuel Gil Peyrot 2016-10-03 22:48:12 +01:00
parent 615d091877
commit 358fce4443
1 changed files with 4 additions and 3 deletions

View File

@ -87,13 +87,14 @@ def main():
xepfile = 'xep-' + xepnum + '.xml'
thexep = parse(xepfile)
links = thexep.getElementsByTagName("link")
deadlinks = 0
if verbose:
print 'Checking XEP-' + xepnum + ':'
for link in links:
url = link.getAttribute("url")
urls = [link.getAttribute("url") for link in thexep.getElementsByTagName("link")]
urls += [image.getAttribute("src") for image in thexep.getElementsByTagName("img")]
for url in set(urls):
if is_dead(url):
deadlinks += 1