Discord Parser RSS is a simple Discord bot built on Python that does two things:
- Bring your RSS subscriptions for last 24 hours on command;
- Parse web-sites and prints text directly into channel.
- Clone this repository and keep it private.
- At Discord Developer Portal create new application. Remember
Client ID
. - At application page on Discord Developer Portal create a bot and save token (KEEP IT SECRET.)
- Create a Discord Server or be sure to have bot-inviting rights on existing one.
- Invite your bot to server by link:
https://discord.com/oauth2/authorize?client_id=[Client ID numbers]&scope=bot
. - Get back to GitHub and save your token in code, 11th line. Alternatively, there are ways to load your token into file. Discussed below.
- Create a Heroku account.
- Create a new App with unique name. On
Settings
page inBuildpack
choose Python. - On
Deploy
page link your Heroku account to Github account, choose your Discord Parser RSS Bot repository and deploy it. - On
Resources
page activate worker. - Test your bot. It should work now, except
?rss_daily
command. - In
FEED_URL
(line 32) add all your XML RSS subscriptions, push and re-deploy. All set.
You either can set up an .env at Heroku (check manual) or load it locally, through a JSON-mapping
, for example. Latter will require installing of Heroku CLI and, of course addition of according .gitignore
line. You will stage your bot directly from your local repository, so you won't need a GitHub linking to Heroku anymore.
- Parse function prints all the text on page, despite how page long is. If you're using it for same sites, you may want to make it parse through specific block-codes on page. Of course, every site has different HTML structure, so you will have to write code for every situation.
- If you're setting bot not only for yourself, but for a community, you may want to add user commands to add to FEED_URL.
- RSS function is set to bring links of content. If your subscription is, for example, photos, you'll have to change parsed XML-structure accordingly.