Compare commits

...

2 commits

Author SHA1 Message Date
A.M. Rowsell
5faf789e82
added .gitignore 2025-02-02 11:23:23 -05:00
A.M. Rowsell
422a717526
Changed embed colour, footer, removed datetime, added error detection 2025-02-02 11:21:52 -05:00
2 changed files with 9 additions and 4 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
*.conf
*.txt
log/

View file

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