diff --git a/discorss.py b/discorss.py index 56d5d16..403b864 100755 --- a/discorss.py +++ b/discorss.py @@ -19,6 +19,7 @@ import json import time import os import sys +import argparse import re config_dir = os.environ.get("XDG_CONFIG_HOME") @@ -144,9 +145,13 @@ def main(): ) # Hash the title and time of the latest post and use that to determine if it's been posted # Yes, SHA3-512 is totally unnecessary for this purpose, but I love SHA3 - new_hash = hashlib.sha3_512( - bytes(latest_post["title"] + str(published_time), "utf-8") - ).hexdigest() + try: + new_hash = hashlib.sha3_512( + bytes(latest_post["title"] + str(published_time), "utf-8") + ).hexdigest() + except TypeError: + logger.error("Title of %s isn't hashing correctly", hook["name"]) + continue try: if hook["lasthash"] != new_hash: app_config["feeds"][i]["lasthash"] = new_hash @@ -169,10 +174,10 @@ def main(): { "title": str(latest_post["title"]), "url": str(latest_post["link"]), - "color": 216128, + "color": 2123412, "footer": { - "name": "DiscoRSS", - # "url": "https://git.frzn.dev/amr/discorss", + "text": "DiscoRSS", + "icon_url": "https://frzn.dev/~amr/images/discorss.png", }, "author": { "name": str(hook["name"]), @@ -184,6 +189,7 @@ def main(): "value": get_description(latest_post), } ], + # "timestamp": str(now), } ], "attachments": [], diff --git a/install.sh b/install.sh old mode 100644 new mode 100755