From 92d25dc356e08bb65bb4e4bc21448a94002223f3 Mon Sep 17 00:00:00 2001 From: Sam Ireland Date: Wed, 30 Dec 2020 23:47:15 +0000 Subject: [PATCH] Save post content --- html/post.html | 6 ++++++ utilities.py | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/html/post.html b/html/post.html index 05d9bb5..4b461ae 100644 --- a/html/post.html +++ b/html/post.html @@ -1,4 +1,10 @@

+Link +
+
+
+ +
\ No newline at end of file diff --git a/utilities.py b/utilities.py index 23ae104..84f97ad 100644 --- a/utilities.py +++ b/utilities.py @@ -31,6 +31,10 @@ def get_post_html(post): html = f.read() dt = datetime.utcfromtimestamp(post.created_utc) html = html.replace("", post.title) + html = html.replace("", f"/r/{str(post.subreddit)}") + html = html.replace("", f"/u/{post.author.name}" if post.author else "[deleted]") + html = html.replace("", f"https://reddit.com{post.permalink}") + html = html.replace("", post.selftext_html or "") html = html.replace("", str(dt)) html = html.replace("", dt.strftime("%d %B, %Y")) return html \ No newline at end of file