(rss in DISCORD): a very simple and easy to use RSS feed posting script that works via magic. Well, webhooks and python.
- Requests
- feedparser
- dotenv
- PyYAML
- You need a Discord webhook link so first setup a webhook for your discord server. Learn how to do that here.
Do not share this webhook link with anyone. Anyone with this link can post anything they want to your discord server.
git clone https://github.com/DomicidalDesigns/DISrssCORD.git
or download this repo
-
Edit
env.example
. -
Change
YOUR-WEBHOOK-ID
to whatever the rest of your webhook link looks like.- Include everything after
https://discordapp.com/api/webhooks/
. - If your link was
https://discordapp.com/api/webhooks/123456789/NotARealLink/
then your .env file would look like:WEBHOOK_ID=123456789/NotARealLink
- Include everything after
-
Save
env.example
as.env
Do not share this file with anyone. Do not put this file in version control. Anyone with this link can post anything they want to your discord server.
- Open up your favorite console and run
python DISrssCORD.py
Simply add a RSS feed URL to the end of the rss_urls.yaml file and add a colon after the url
https://www.wired.com/feed/category/science/latest/rss:
The YAML file is a dictionary with the URL of the RSS feed as the key and the last posted article URL as the value. This ensures you aren't posting the same article over and over. The script compares the newest article link to the link saved in the YAML file.
Previously I used a text file for each RSS feed and just listed the RSS links inside the python file, but that was way messier and required restarting the program to add new URLs. This way you can easily add RSS feeds and it keeps everything in one simple file.