From 5349fc4c9651767201b726dcb7e841ef3ca82383 Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Mon, 6 Nov 2017 21:41:27 +1100 Subject: [PATCH] Handle webmention endpoint discovery separately - sendWebmention() is meant to do it itself but doesn't quite work --- entries/jobs.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/entries/jobs.py b/entries/jobs.py index 49968c7..77664d9 100644 --- a/entries/jobs.py +++ b/entries/jobs.py @@ -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)