I figured out what the issue was. Discord was trying to tell me there was a problem with the embed I was sending. The provider value was removed, and with some other tweaks it all started working. Heavy, heavy facepalm. |
||
---|---|---|
discorss.py | ||
LICENSE | ||
README.md |
DiscoRSS
What is it?
DiscoRSS is a simple Python script to send RSS feeds to Discord webhooks. It was created because existing bots that did this set limits on the number of feeds, and self-hosting stuff is easier and better anyway. To get this working, you will require the following Python libraries:
requests >= 2.4.2
feedparser
The remaining imports should all be part of the standard Python install. To configure the script, create /etc/discorss.conf with the following structure:
{
"feeds": [
{
"name": "phoronix",
"url": "http://www.phoronix.com/rss.php",
"webhook": "webhook url"
},
{
"name": "pagetable",
"url": "https://www.pagetable.com/?feed=rss2",
"webhook": "webhook url"
},
{
"name": "righto",
"url": "https://www.righto.com/feeds/posts/default",
"webhook": "webhook url",
"offset": -18000
}
]
}
The offset should only be required if feeds aren't showing up. This is because feedparser, in its infinite wisdom, just ignores the timezone when converting publish dates from feeds. So most feeds end up with an epoch in UTC. The offset should be the number of seconds between your time zone and UTC. This will eventually be fixed in a future update, I just need to sit down and wrangle with feedparser and datetime some more.
To automate feed posting, create a systemd service and timer to execute the script. I will include examples soon.