Skip to content

Python script to automate the submission of the HKU gym booking form, streamlining the booking process for enhanced efficiency and convenience

Notifications You must be signed in to change notification settings

jicsontoh/HKU-Gym-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

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.

About

Python script to automate the submission of the HKU gym booking form, streamlining the booking process for enhanced efficiency and convenience

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages