/u-cursed

Discord web scraper bot that gets information on available engineering courses at University of Chile

Primary LanguagePythonMIT LicenseMIT

U-Cursed

Discord Bot that web-scraps U-Cursos and U-Campus to get information about engineering courses from the Universidad de Chile.

Description

Discord.py bot that uses beautifulsoup to embed information obtained from both U-Cursos and U-Campus according to the given course, it uses public data and does not require to log in.

I suggest that you don't overuse this bot since U-Cursos gets a lot of traffic depending on the time of year. This project is both for entertainment and learning purposes only.

Check the self-hosting section to get more information about the project's structure and how to run this by yourself.

Getting Started

Inviting the bot

The bot is currently being hosted at Heroku, not very efficient and runs out of Dynos by the end of the month but gets the job done (might make new schedules to turn it on and off). You can invite it to your server by using this link.

Useful commands

u help

Gets you general info about the bot and how to use it to your discord DMs.

u status

Information about the bot: ping, guilds and version.

u status example

u post

This embeds the last post in said course and section if it's publicly available, you can click it if logged in your browser to get to the post inmediately. The syntax is as follows:

u post required_course_code (optional_section=1)

u post example

u horario

This embeds the course's section schedule for the current, previous or next week. The syntax is a follows:

u post required_course_code required_section (optional_week = prev|act|sig)

u horario example

u info

This embeds general course information, such as credits, requirements and the program if available. The syntax is as follows:

u info required_course_code

u info example

Self-Hosting

First of all you need to create a virtual python evironment or pip install all the dependencies. You might need to check which python version works fine with discord.py. Then clone this repository.

Dependencies

  • Python 3
  • BeautifulSoup
  • Discord

Bot Token

You need to get your own discord bot token at discord's developer portal and replace it in the bot.py file:

    # bot.run(YOUR_TOKEN)
    bot.run(os.environ['token'])

Invite the bot you created to your server and run bot.py, you should be good to go.

Authors

Polarisu

License

This project is licensed under the [MIT] License - see the LICENSE.md file for details