Whoops, fix up the WebSub ping implementation - it should actually work now
This commit is contained in:
parent
5c643299c7
commit
3cc2fe798f
1 changed files with 2 additions and 5 deletions
|
@ -1,12 +1,9 @@
|
||||||
import requests
|
import requests
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django_rq import job
|
from django_rq import job
|
||||||
from urllib.parse import urlencode
|
|
||||||
|
|
||||||
|
|
||||||
@job
|
@job
|
||||||
def ping_hub(*urls):
|
def ping_hub(*urls):
|
||||||
requests.post(settings.PUSH_HUB, data={
|
data = [('hub.mode', 'publish')] + [('hub.url[]', url) for url in urls]
|
||||||
'hub.mode': 'publish',
|
requests.post(settings.PUSH_HUB, data=data)
|
||||||
'hub.url': ','.join(map(urlencode, urls)),
|
|
||||||
})
|
|
||||||
|
|
Loading…
Reference in a new issue