matomatical / UoM-WAM-Spam

Scraper for the UoM results page which detects transcript updates and notifies the user.
MIT License
60 stars 22 forks source link

UoM WAM Spam

The official results release date is usually about two weeks after the end of the exam period. In practice, subject marks become visible a week or two earlier than the official release date, and can be inferred even earlier by detecting a change in calculated WAM (Weighted Average Mark) as soon as the results are in the system (days before the results themselves are made visible on the results page).

This script periodically checks the my.unimelb results page to detect any changes to your WAM and listed results, and sends you a notification when a change is detected. If you run this script in the background on your computer or on a VPS, you'll be free to enjoy the first few weeks of your holidays without compulsively checking the results page yourself! Or is it just me who does that?

Made with :purple_heart: by Matt, with contributions from CaviarChen, blueset, josephsurin, alanung, abhinavcreed13, and zcduthie.

Installation

Clone this repository to get started WAM Spamming!

The basic WAM Spam script requires Python 3.6 (or higher).

Once you have Python installed, you'll also need the following two third-party Python packages for web scraping:

You can easily install these with pip using the command pip3 install requests beautifulsoup4, or however else you prefer to install Python packages.

Configuration

While the script has sensible default settings, it's also easily configurable. You can modify the constants atop wamspam.py to easily change the behaviour. Some important configuration options are:

There are some other configuration options, all documented in the script itself.

Notifcation methods

The script can notify you using a range of notification methods. Each requires its own configuration, as explained below:

Multiple notification methods

The script can combine multiple notification methods in its attempt to reach you regarding a detected WAM change.

All you'll need to configure each of your desired notification methods individually using the above instructions, and ensure they all get added to the multi-notifier during the configuration section of the script.

That is, to use multiple notification methods, just uncomment and configure multiple notification methods!

Usage

Once you have installed the requirements and configured the script, simply run it with python3 wamspam.py.

The script will ask you for your unimelb username and password. It uses these to log into the results page on your behalf every however-many minutes you configured, looking for updated results. It stores the previous results in a JSON-formatted text file between checks, for comparison.

The first time the script finds your results, or whenever it sees your results data change, the script will also send you a notification using your configured notification method(s).

Note: Don't forget to stop the script after the final results release date!

Common issues

The script is not very robust. If anything goes wrong, it will probably crash with an overly dramatic error message. Please see these possible errors:

The script crashes with an error: InvalidLoginException.

You might have typed your username or password wrong. Please check that you got them right, and try again.

Contributions

This app is more useful and robust as a result of our contributors' efforts, and we welcome new contributions. This is also a very simple app with a low barrier to contribution, so a great first open source project to work on for beginning/intermediate programmers. (Matt is also grateful for the contributions of more experienced developers, which have helped to shape this app.)

Notes:

Happy hacking :).

New integrations

Are we missing your favourite messaging app that supports automation? We welcome pull requests adding new integrations, as long they contain clear and complete instructions for anyone to be able to configure the method.

The requirements are:

  1. Adding the implementation of the notification method to the notify directory.
  2. Configuring the notification method atop the main script.
  3. Adding configuration instructions to the README.

There are plenty of examples to follow in each of these places.

The steps involved to make a contribution are:

  1. Fork this repository
  2. Work in your fork, in whichever branch(es) you prefer
  3. Test your integration and instructions
  4. Open a pull request straight into this repo's 'main' branch
  5. Wait for Matt to review and merge the changes, or suggest improvements

Good luck! And feel free to ask for help with any of these steps.

Other suggestions

Do you see some other way to improve this app? You can start a discussion by creating an 'issue' and making your case for the improvement! If we agree, we'll invite you to make a pull request.

(In the mean time, you can make the change in your own fork of the app, and use this version to look out for your results).

Ideas

Existing ideas for improvements: