diff --git a/app.yaml b/app.yaml index ff877db0..948368c1 100644 --- a/app.yaml +++ b/app.yaml @@ -71,6 +71,10 @@ handlers: script: redirect.app secure: always +- url: /superfeedr/.* + script: superfeedr.app + secure: always + - url: /wm/.+ script: add_webmention.app secure: always diff --git a/superfeedr.py b/superfeedr.py new file mode 100644 index 00000000..27b08b2d --- /dev/null +++ b/superfeedr.py @@ -0,0 +1,29 @@ +"""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 + +import webapp2 + +import appengine_config + + +class SuperfeedrHandler(webapp2.RequestHandler): + """Superfeedr subscription callback handler. + + https://documentation.superfeedr.com/publishers.html#subscription-callback + """ + + def post(self): + logging.info('Got:\n%s', self.request.body) + self.response.status_int = 204 + + get = post + + +app = webapp2.WSGIApplication([ + (r'/superfeedr/.*', SuperfeedrHandler), +], debug=appengine_config.DEBUG)