Added sha3_512 hash of post title, to migrate from using time

This commit is contained in:
A.M. Rowsell 2025-02-05 23:28:14 -05:00
parent bd693f6f42
commit 87193d0f94
Signed by: amr
GPG key ID: 0B6E2D8375CF79A9

View file

@ -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