From 93f3613dab38125d9ae7d5e74498c5395ac80ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Gl=C3=BCpker?= Date: Sun, 9 May 2021 20:13:08 +0200 Subject: Unify method returns / return RSS object --- netto.py | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) (limited to 'netto.py') diff --git a/netto.py b/netto.py index fda6409..2867edf 100755 --- a/netto.py +++ b/netto.py @@ -36,34 +36,21 @@ def netto(store_id): year = str(datetime.now().year) title = url[ url.find(year) : url.find(year) + 7 ] - return title, url + return { + title: 'Netto Angebote für ' + store_id, + url: 'https://www.netto-online.de/ueber-netto/Online-Prospekte.chtm/' + store_id, + description: 'PDF der neuen Netto Angebote für den Laden um die Ecke.', + content: [{ + 'title': 'Angebote für ' + title, + 'url': url, + 'content': 'Angebote für ' + title + ' finden sich unter ' + url, + }] + } -def main(store_id = 9110): - url = 'https://www.netto-online.de/ueber-netto/Online-Prospekte.chtm/' + str(store_id) - print(""" - - - Netto Angebote """ + str(store_id) + """ - """ + url + """ - PDF der neuen Netto Angebote für den Laden um die Ecke. - """ + _format_date(datetime.now()) + """""") - - title, link = netto(url) - print(' ') - print(' <![CDATA[Angebote für ' + title + ']]>') - print(' ' + link + '') - # print(' ') - # print(' ' + date + '') - # print(' ') - print(' ') +def main(store_id = 9110): + print(netto(store_id)) - print(' ') - print('') if __name__ == "__main__": - # if len(sys.argv) != 2: - # print('Usage:', sys.argv[0], '') - # sys.exit(1) - # main(sys.argv[1]) main() -- cgit v1.2.3