Handle webmention endpoint discovery separately - sendWebmention() is meant to do it itself but doesn't quite work

This commit is contained in:
Danielle McLean 2017-11-06 21:41:27 +11:00
parent 5308e28d98
commit 5349fc4c96
Signed by untrusted user: 00dani
GPG key ID: 5A5D2D1AFF12EEC5

View file

@ -11,7 +11,9 @@ def ping_hub(*urls):
@job
def send_mentions(url):
result = webmention.findMentions(url)
def send_mentions(source):
result = webmention.findMentions(source)
for target in result['refs']:
webmention.sendWebmention(url, target)
status, endpoint = webmention.discoverEndpoint(target)
if endpoint is not None and status == 200:
webmention.sendWebmention(source, target, endpoint)