Skip to content

Virusmint/seat-scraper

Repository files navigation

McGill Seat Scraper

Automated web scraper to poll course enrollment status on minerva, and ping via webhook when seats/waitlist spots open up.

Installation

The only requirement is to have a server with docker installed (and old laptop can do just fine). Preferably, it should have a constant up-time so as to not miss any seat openings.

  1. Setup your webhook (e.g. Discord, Slack) and get the URL.
cp .env.example .env
  1. Fill in your minerva credentials and webhook URL in the .env file.
USERNAME=your_minerva_username
PASSWORD=your_minerva_password
WEBHOOK_URL=your_webhook_url
  1. Define your courses in courses.yaml in the following format (no particular ordering of terms or courses is required):
terms:
  F2025:
    - COMP202
    - MATH240
  W2026:
    - LING210
  S2026:
    - PHYS183
  <term>:
    - <section><number>

Usage

Warning

Only one instance of the scraper can be running at a time since minerva does not like multiple logins from the same account - you might notice the scraper crashing while you are browsing minerva.

  • Docker (Recommended)
docker-compose up --build
  • Local development
python -m src.minerva --config config.yaml --local

Automation

To automate the scraper, you can set up a cron job to run the scraper container at regular intervals. First, make sure your script is executable:

chmod +x /path/to/run_scraper.sh

Then, open the crontab file for editing:

crontab -e

And add the following line to schedule the scraper:

# e.g. Run every 30 minutes
*/30 * * * * /path/to/run_scraper.sh

Future Work

The next logical step would be to add auto-enrollment functionality. In hindsight, this is quite easy to implement, but it would require a lot of testing to make sure it works reliably (i.e. does not mess up with other registered courses).

The other problem is that there is a limit to the number of credits a student can be enrolled in, so a priority system might be interesting to consider.

About

Scrape for seats in minerva

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors