bridgy-fed/superfeedr.py

25 wiersze
669 B
Python
Czysty Zwykły widok Historia

"""Superfeedr callback handlers.
Not really sure what this will be yet. Background:
https://github.com/snarfed/bridgy-fed/issues/18#issuecomment-430731476
https://documentation.superfeedr.com/publishers.html
"""
import logging
2021-07-08 14:36:19 +00:00
from flask import request
2021-07-08 14:36:19 +00:00
from app import app
logger = logging.getLogger(__name__)
2021-07-08 14:36:19 +00:00
@app.route(r'/superfeedr/', methods=['GET', 'POST'])
@app.route(r'/superfeedr/<path:_>', methods=['GET', 'POST'])
def superfeedr(_=None):
"""Superfeedr subscription callback handler.
https://documentation.superfeedr.com/publishers.html#subscription-callback
"""
logger.info(f'Got:\n{request.get_data(as_text=True)}')
2021-07-08 14:36:19 +00:00
return '', 204