diff options
author | André Glüpker <git@wgmd.de> | 2021-05-09 20:13:08 +0200 |
---|---|---|
committer | André Glüpker <git@wgmd.de> | 2021-05-09 20:23:18 +0200 |
commit | 93f3613dab38125d9ae7d5e74498c5395ac80ab0 (patch) | |
tree | 4f1a80138a83c98348464f1b9ddd949766441488 /webapp.py | |
parent | 5774dbfb2caa42cb55bafab98a40e47f395e44d9 (diff) | |
download | rss-feeds-93f3613dab38125d9ae7d5e74498c5395ac80ab0.tar.gz rss-feeds-93f3613dab38125d9ae7d5e74498c5395ac80ab0.tar.bz2 rss-feeds-93f3613dab38125d9ae7d5e74498c5395ac80ab0.zip |
Unify method returns / return RSS object
Diffstat (limited to 'webapp.py')
-rwxr-xr-x | webapp.py | 51 |
1 files changed, 15 insertions, 36 deletions
@@ -35,55 +35,34 @@ def not_found(e): @app.route("/twitter/<account>") def feedTwitter(account): - content = [{'title': t, 'url': u, 'content': c, 'date': d, 'enclosures': e} - for t,c,u,d,e in twitter(account)] - xml = buildRSS( - title = 'Twitter: ' + account, - url = 'https://twitter.com/' + account, - description = 'The latest entries of the twitter account of ' + account, - content = content) + xml = buildRSS(twitter(account)) response = Response(xml, mimetype='text/xml') response.headers['Access-Control-Allow-Origin'] = '*' return response -@app.route("/telegram/<account>") -def feedTelegram(account): - content = [{'title': t, 'url': u, 'content': c, 'date': d} - for t,c,u,d in telegram(account)] - xml = buildRSS( - title = 'Telegram: ' + account, - url = 'https://t.me/s/' + account, - description = 'The latest entries of the telegram channel of ' + account, - content = content) - response = Response(xml, mimetype='text/xml') - response.headers['Access-Control-Allow-Origin'] = '*' - return response +# @app.route("/telegram/<account>") +# def feedTelegram(account): +# content = [{'title': t, 'url': u, 'content': c, 'date': d} +# for t,c,u,d in telegram(account)] +# xml = buildRSS( +# title = 'Telegram: ' + account, +# url = 'https://t.me/s/' + account, +# description = 'The latest entries of the telegram channel of ' + account, +# content = content) +# response = Response(xml, mimetype='text/xml') +# response.headers['Access-Control-Allow-Origin'] = '*' +# return response @app.route("/netto/<market>") def feedNetto(market): - title, url = netto(market) - content = [{ - 'title': 'Angebote für ' + title, - 'url': url, - 'content': 'Angebote für ' + title + ' finden sich unter ' + url, - }] - xml = buildRSS( - title = 'Netto Angebote für ' + market, - url = 'https://www.netto-online.de/ueber-netto/Online-Prospekte.chtm/' + market, - description = 'PDF der neuen Netto Angebote für den Laden um die Ecke.', - content = content) + xml = buildRSS(netto(market)) response = Response(xml, mimetype='text/xml') response.headers['Access-Control-Allow-Origin'] = '*' return response @app.route("/zdf/<path:feed>") def filterZDFFeed(feed): - title, url, description, content = zdf(feed) - xml = buildRSS( - title = title, - url = url, - description = description, - content = content) + xml = buildRSS(zdf(feed)) response = Response(xml, mimetype='text/xml') response.headers['Access-Control-Allow-Origin'] = '*' return response |