1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-28 04:02:20 -05:00

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

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