A python script that can help you fill and submit the HKU gym booking form. This script can also be scheduled using cron jobs so that you do not need to fret over getting your desired gym slot 💪
HKU-Gym-Bot.mov
- Clone this repo
$ git clone https://github.com/jicsontoh/HKU-Gym-Bot.git
- Create and set up your env variables in a .env file
EMAIL=
NAME=
STUDENT_NUM=
- Set the path to your chrome browser app in Service
SER = Service("/Applications/Google\ Chrome.app")
- The script runs with the following command syntax
$ python hku_gym_bot.py [CENTRE] [DATE] [TIMESLOT]
[CENTRE] can be replaced by any of the following centre abbreviations
Abbreviation | Represents |
---|---|
CSE | CSE Active |
B-Active | HKU B-Active |
SHSC | Stanley Ho Sports Centre |
[DATE] should follow this format strictly: YYYY/MM/DD
[TIMESLOT] is based on the various centres
Centre | Timeslots |
---|---|
CSE Active | 1245-1415 1715-1845 |
HKU B-Active | 1700-1830 1845-2015 2030-2200 |
Stanley Ho Sports Centre | 1745-1915 1930-2100 |
- Note: You can uncomment the following line to run the script without any visible UI.
# op.add_argument('--headless')
- The booking form has a reCAPTCHA element that detects bots such as Selenium (the API we're using) and this script occasionally may not work as desired. To overcome this, you may need to use a VPN or rotate proxies.