We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f2e7eff + f29879a commit 0b42311Copy full SHA for 0b42311
webmentiontools/send.py
@@ -49,12 +49,14 @@ def _discoverEndpoint(self):
49
# look in the content
50
html = r.text
51
soup = BeautifulSoup(html)
52
- tag = soup.find('link', attrs={'rel': 'webmention'})
53
- if not tag:
54
- # backward compatibility with the webmention 0.1 spec
55
- tag = soup.find('link', attrs={'rel': 'http://webmention.org/'})
+ tag = None
+ for name in 'link', 'a':
+ for rel in 'webmention', 'http://webmention.org/':
+ tag = soup.find(name, attrs={'rel': rel})
56
+ if tag:
57
+ break
58
- if tag and tag['href']:
59
+ if tag and tag.get('href'):
60
# add the base scheme and host to relative endpoints
61
self.receiver_endpoint = urlparse.urljoin(self.target_url, tag['href'])
62
else:
0 commit comments