From 87193d0f9402a3578e4b6e18952338d45dcc48da Mon Sep 17 00:00:00 2001 From: "A.M. Rowsell" Date: Wed, 5 Feb 2025 23:28:14 -0500 Subject: [PATCH] Added sha3_512 hash of post title, to migrate from using time --- discorss.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/discorss.py b/discorss.py index b869e7c..7eb752e 100755 --- a/discorss.py +++ b/discorss.py @@ -69,7 +69,8 @@ def main(): published_time = time.mktime(feed.entries[0]["published_parsed"]) published_time = published_time + hook["offset"] print("Parsing feed {}...".format(hook["name"])) - new_hash = hashlib.sha3_512(feed.entries[0]["title"]) + # Hash the title of the latest post and use that to determine if it's been posted + new_hash = hashlib.sha3_512(bytes(feed.entries[0]["title"], 'utf-8')).hexdigest() try: if hook["lasthash"] != new_hash: app_config["feeds"][i]["lasthash"] = new_hash