summaryrefslogtreecommitdiff
path: root/webapp.py
diff options
context:
space:
mode:
Diffstat (limited to 'webapp.py')
-rwxr-xr-xwebapp.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/webapp.py b/webapp.py
index 62a1bdf..0e65573 100755
--- a/webapp.py
+++ b/webapp.py
@@ -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)
-