Skip to content

A simple python script to send posts from multiple rss feeds via webhook to a discord channel

License

Notifications You must be signed in to change notification settings

DomicidalDesigns/DISrssCORD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DISrssCORD

A simple python script to send posts from multiple rss feeds to a discord channel via webhook

Description

(rss in DISCORD): a very simple and easy to use RSS feed posting script that works via magic. Well, webhooks and python.

Dependencies

  • Requests
  • feedparser
  • dotenv
  • PyYAML

How to Use

Setup Your Webhook

  • 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.

Clone this repo

  • git clone https://github.com/DomicidalDesigns/DISrssCORD.git or download this repo

Change Webhook Environment Variable

  • 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
  • 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.

Run DISrssCORD

  • Open up your favorite console and run python DISrssCORD.py

How to Add Feeds

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:

What's up with the YAML file?

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.

About

A simple python script to send posts from multiple rss feeds via webhook to a discord channel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages