From 422a71752672dd841c1a7618d9c0b0a5d69fbdb4 Mon Sep 17 00:00:00 2001 From: "A.M. Rowsell" Date: Sun, 2 Feb 2025 11:21:52 -0500 Subject: [PATCH] Changed embed colour, footer, removed datetime, added error detection --- discorss.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/discorss.py b/discorss.py index 288aa4e..c720c68 100755 --- a/discorss.py +++ b/discorss.py @@ -14,7 +14,7 @@ import requests import feedparser from pathlib import Path import json -import datetime +# import datetime import time import os @@ -66,10 +66,10 @@ def main(): { "title": str(feed.entries[0]["title"]), "url": str(feed.entries[0]["link"]), - "color": 5814783, - "provider": { + "color": 216128, + "footer": { "name": "DiscoRSS", - "url": "https://git.frzn.dev/amr/discorss", + # "url": "https://git.frzn.dev/amr/discorss", }, "author": {"name": str(hook["name"]), "url": str(hook["siteurl"])}, "fields": [ @@ -92,6 +92,8 @@ def main(): r = requests.post( hook["webhook"], data=webhook_string, headers=custom_header ) + if r.status_code != '200': + print("Error {} while trying to post {}".format(r.status_code, hook["webhook"])) app_config["lastupdate"] = now with open(config_file_path, "w") as config_file: json.dump(app_config, config_file, indent=4)