A tool to automate booking your favorite sports activities at TUNI using Playwright (Go).
- Go version 1.24.1+ or newer must be installed.
-
Clone the repository:
git clone https://github.com/gvx3/sportuni-book.git cd sportuni-booker
-
Install dependencies and Playwright browsers:
make setup
-
At the root directory of the project, build the binary:
go build -o sb
-
Run application
./sb # or specify a config file ./sb -f /path/to/config.yaml
The application requires a YAML configuration file. The config file can be located in one of the following places:
- The current working directory (where you run the program):
./config.yaml
- The user home directory:
- On Unix/MacOS:
~/.sportuni/config.yaml
- On Windows:
C:\Users\<YourUsername>\.sportuni\config.yaml
- On Unix/MacOS:
You can also specify a custom config file location using the CLI flag -f
or --file
:
./sb -f /path/to/your/config.yaml
base_url: "https://www.tuni.fi/sportuni/omasivu/?newPage=selection&lang=en"
email: "[email protected]"
password: "your_password"
state_file_name: "ms_user.json"
# activity values: Badminton, Billiards
# course_area values: hervanta, kauppi, citycentre
activity_slots:
- day: "Tue"
date: ""
hour: "08:00"
activity: "Badminton"
course_area: "hervanta"
- day: "Thu"
date: ""
hour: "13:00"
activity: "Billiards"
course_area: "citycentre"