diff options
Diffstat (limited to 'netto.py')
-rwxr-xr-x | netto.py | 37 |
1 files changed, 12 insertions, 25 deletions
@@ -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("""<?xml version="1.0" encoding="UTF-8"?> -<rss version="2.0"> - <channel> - <title>Netto Angebote """ + str(store_id) + """</title> - <link>""" + url + """</link> - <description>PDF der neuen Netto Angebote für den Laden um die Ecke.</description> - <lastBuildDate>""" + _format_date(datetime.now()) + """</lastBuildDate>""") - - title, link = netto(url) - print(' <item>') - print(' <title><![CDATA[Angebote für ' + title + ']]></title>') - print(' <link>' + link + '</link>') - # print(' <description><![CDATA[' + description + ']]></description>') - # print(' <pubDate>' + date + '</pubDate>') - # print(' <media:content url="' + thumbnail + b'" type="image/jpeg" />') - print(' </item>') +def main(store_id = 9110): + print(netto(store_id)) - print(' </channel>') - print('</rss>') if __name__ == "__main__": - # if len(sys.argv) != 2: - # print('Usage:', sys.argv[0], '<foobar>') - # sys.exit(1) - # main(sys.argv[1]) main() |