Rewrote main.py

This commit is contained in:
2025-08-30 22:32:21 -05:00
parent 126abd64a1
commit 0f547ba758
8 changed files with 146 additions and 86 deletions

View File

@@ -0,0 +1,23 @@
from typing import List
import feedparser
import tomllib
import json
with open("config.toml","rb") as file:
config = tomllib.load(file)
print(config)
previous_msgs = set()
def read_rss_feeds(client):
for feed_name,feed_link in config["rss-feeds"].items():
feed = feedparser.parse(feed_link)
for feed_post in feed.entries:
if feed_post.title in previous_msgs:
continue
else:
previous_msgs.add(feed_post.title)
notif_json = {"title":feed_post.title,"body":feed_post.description,"topic":"overlordian-news-192","link":feed_post.link}
client.publish("notification-pusher",json.dumps(notif_json),0)