Skip to content

Latest commit

 

History

History
65 lines (45 loc) · 1.87 KB

README.md

File metadata and controls

65 lines (45 loc) · 1.87 KB

HKU Gym Bot

Basic Overview

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 💪

Demonstration of Gym Bot

HKU-Gym-Bot.mov

How to install

  1. Clone this repo
$ git clone https://github.com/jicsontoh/HKU-Gym-Bot.git
  1. Create and set up your env variables in a .env file
EMAIL=
NAME=
STUDENT_NUM=
  1. Set the path to your chrome browser app in Service
SER = Service("/Applications/Google\ Chrome.app")

How to use

  • 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')

Known issues

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