diff options
author | André Glüpker <git@wgmd.de> | 2021-07-29 10:48:55 +0200 |
---|---|---|
committer | André Glüpker <git@wgmd.de> | 2021-07-29 10:51:55 +0200 |
commit | b526cc68929250a7f71ff21ed8410ffd8db87a9d (patch) | |
tree | 54ff4b25b4eea9a142a46741eaf502116b030383 /webapp.py | |
parent | af15eade0f59c17c4867baffe0e1dc05033b06c8 (diff) | |
download | rss-feeds-b526cc68929250a7f71ff21ed8410ffd8db87a9d.tar.gz rss-feeds-b526cc68929250a7f71ff21ed8410ffd8db87a9d.tar.bz2 rss-feeds-b526cc68929250a7f71ff21ed8410ffd8db87a9d.zip |
Format using black
Diffstat (limited to 'webapp.py')
-rwxr-xr-x | webapp.py | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -12,11 +12,10 @@ import os import re import sys import time, datetime -# import traceback import logging from twitter import twitter -from telegram import telegram +# from telegram import telegram from netto import netto from rss import buildRSS from zdf import zdf @@ -27,25 +26,26 @@ app.secret_key = "NMcgoB.0wd+$.KVKj!F{3>U{%BBUVhL=7=5$:46rQH$Q{enCuU" def rssResponse(data): rss = buildRSS(data) - response = Response(rss, mimetype='text/xml') - response.headers['Access-Control-Allow-Origin'] = '*' + response = Response(rss, mimetype="text/xml") + response.headers["Access-Control-Allow-Origin"] = "*" return response @app.route("/") def main(): - return 'this is sparta' + return "this is sparta" @app.errorhandler(404) def not_found(e): - return 'Die angeforderte Seite konnte nicht gefunden werden.' + return "Die angeforderte Seite konnte nicht gefunden werden." @app.route("/twitter/<account>") def feedTwitter(account): return rssResponse(twitter(account)) + # @app.route("/telegram/<account>") # def feedTelegram(account): # content = [{'title': t, 'url': u, 'content': c, 'date': d} @@ -59,6 +59,7 @@ def feedTwitter(account): # response.headers['Access-Control-Allow-Origin'] = '*' # return response + @app.route("/netto/<market>") def feedNetto(market): return rssResponse(netto(market)) @@ -69,9 +70,8 @@ def filterZDFFeed(feed): return rssResponse(zdf(feed)) -if __name__ == '__main__': - logging.basicConfig(filename='./main.log', level=logging.INFO) +if __name__ == "__main__": + logging.basicConfig(filename="./main.log", level=logging.INFO) - app.config['TEMPLATES_AUTO_RELOAD'] = True + app.config["TEMPLATES_AUTO_RELOAD"] = True app.run(threaded=True) - |