From 67b39a42a97efe26a9292af9ab400b26627b62a5 Mon Sep 17 00:00:00 2001 From: DasMoorhuhn Date: Sat, 4 Feb 2023 14:09:04 +0100 Subject: [PATCH] finished xkcd --- src/addons.py | 24 ++++++++++++++++-------- src/main.py | 13 ++++++++----- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/addons.py b/src/addons.py index e6a9c21..9b44b51 100644 --- a/src/addons.py +++ b/src/addons.py @@ -22,16 +22,24 @@ class XKCD: def getRandomComic(self): response = requests.get(url=f"https://c.xkcd.com/random/comic") - with open(file="data/log/comic.html", mode="w") as file: - file.write(response.text) - file.close() - for line in response.text: + for line in response.text.split("\n"): if '