forked from 00dani/lemoncurry
Add simple support for sending Webmentions using the ronkyuu library
This commit is contained in:
parent
3cc2fe798f
commit
78b2f8220d
4 changed files with 19 additions and 2 deletions
|
@ -1,9 +1,17 @@
|
|||
import requests
|
||||
from django.conf import settings
|
||||
from django_rq import job
|
||||
from ronkyuu import webmention
|
||||
|
||||
|
||||
@job
|
||||
def ping_hub(*urls):
|
||||
data = [('hub.mode', 'publish')] + [('hub.url[]', url) for url in urls]
|
||||
requests.post(settings.PUSH_HUB, data=data)
|
||||
|
||||
|
||||
@job
|
||||
def send_mentions(url):
|
||||
result = webmention.findMentions(url)
|
||||
for target in result['refs']:
|
||||
webmention.sendWebmention(url, target)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue