change port and fake dates

This commit is contained in:
crunk 2023-10-07 18:41:38 +02:00
parent d86692ebf6
commit c239a6e227
2 changed files with 8 additions and 2 deletions

View File

@ -1,4 +1,5 @@
import random import random
from datetime import datetime
from feedparser import parse from feedparser import parse
@ -17,9 +18,13 @@ def parse_single_rss_feed(url, entries, tag_filter):
entries[title] = [] entries[title] = []
entrylist = entries[title] entrylist = entries[title]
entrylist.append(entry.description) entrylist.append(entry.description)
entrylist.append(entry.published_parsed) if entry.has_key("published_parsed"):
entrylist.append(entry.published_parsed)
else:
entrylist.append(datetime.now().timetuple())
return entries return entries
def contains_category(entry, tag_filter): def contains_category(entry, tag_filter):
if not entry.has_key("tags"): if not entry.has_key("tags"):
return False return False
@ -28,6 +33,7 @@ def contains_category(entry, tag_filter):
return True return True
return False return False
def parse_rss_feeds(urls, tag_filter): def parse_rss_feeds(urls, tag_filter):
entries = {} entries = {}
for url in urls: for url in urls:

View File

@ -32,4 +32,4 @@ def load_json_file():
if __name__ == "__main__": if __name__ == "__main__":
APP.debug = True APP.debug = True
APP.run(port=5000) APP.run(port=8080)