Coder Social home page Coder Social logo

ktyjixy / discord-parser-rss-public Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 6 KB

Simple Discord bot that does two things: works as RSS and can parse page specified by a link right into discord.

Python 100.00%
python3 discord-bot web-parser rss-feed

discord-parser-rss-public's Introduction

Discord Parser RSS Bot

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.

Getting it started:

  1. Clone this repository and keep it private.
  2. At Discord Developer Portal create new application. Remember Client ID.
  3. At application page on Discord Developer Portal create a bot and save token (KEEP IT SECRET.)
  4. Create a Discord Server or be sure to have bot-inviting rights on existing one.
  5. Invite your bot to server by link: https://discord.com/oauth2/authorize?client_id=[Client ID numbers]&scope=bot.
  6. Get back to GitHub and save your token in code, 11th line. Alternatively, there are ways to load your token into file. Discussed below.
  7. Create a Heroku account.
  8. Create a new App with unique name. On Settings page in Buildpack choose Python.
  9. On Deploy page link your Heroku account to Github account, choose your Discord Parser RSS Bot repository and deploy it.
  10. On Resources page activate worker.
  11. Test your bot. It should work now, except ?rss_daily command.
  12. In FEED_URL (line 32) add all your XML RSS subscriptions, push and re-deploy. All set.

Loading token into file

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.

Things to consider while using:

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

discord-parser-rss-public's People

Contributors

ktyjixy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.