Python version: 3.8.8
Although it may work with other versions. Not tested yet.
How it works - in a nutshell
It checks for available bookings two days ahead at a specified time.
It will wait till 5 seconds before session time. Then check for booking every 5 seconds. Once a booking has been made, it will wait till the next day. Terminating the program during runtime is safe.
Disclaimer: only for personal usage
- Install python
- Select "Add Python 3.8.8 to PATH"
- Do a custom installation
- Select pip (others, leave as default)
- Hit next
- Select:
- Install for all users
- Add Python to environment variables
- Create shortcuts for installed applications
- Precomplie standard libary
- Customize Install Location and use: C:\Python38
- Hit install
- Default installation
$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:deadsnakes/ppa
$ sudo apt-get update
$ sudo apt-get install python3.8
-
$ git clone https://github.com/tdl1304/AutoTrainingBooker.git
-
Simply enter into cmd/unix terminal:
$ cd AutoTrainingBooker $ python -m venv . $ .\Scripts\activate
$ cd AutoTrainingBooker $ python -m venv . $ source bin/activate
$ cd AutoTrainingBooker $ python3 -m venv . $ source bin/activate
If everything were successful you should get something like this
$ (AutoTrainingBooker) path-to-folder\AutoTrainingBooker>
-
Use "pip3" instead of "pip" for Linux Ubuntu
$ pip install -r requirements.txt
-
Create a distribution with PyInstaller.
While inside the same folder simply enter:
Add-w
for executable without command prompt.$ pyinstaller booker.py -F --name "AutoTrainingBooker" --clean
$ pyinstaller booker.py -F --name "AutoTrainingBooker" --add-binary='/System/Library/Frameworks/Tk.framework/Tk':'tk' --add-binary='/System/Library/Frameworks/Tcl.framework/Tcl':'tcl' --clean
Once done, an executable file should be inside the folder AutoTrainingBooker\dist
- Create new project from git repository and paste in repo-link
- Set your interpreter to python ~3.8 and install all requirements. How-to-do for commandline.
- If you want to create and executable follow this step
-
- Username: [email protected]
- Password: examplepassword NOT THE SAME AS FEIDE
- Studio ID: XXX
- Choices:
- Gløshaugen: 306
- Dragvoll 307
- Portalen: 308
- DMMH: 402
- Moholt: 540
- Choices:
- Booking time: 10:00
-
Username and Password are stored in sit.psw, and Studio ID and Booking time are stored in config.json.
If you wish to edit any of these attributes, simply delete the files and rerun the program or edit the files in a texteditor.
-
It will try to book a session two days ahead at the desired booking time.
- Wrong username and password forces a crash, simply edit sit.psw look here
- In rare occurrences, the user is denied from access to sit.no, this could likely be because of many repeated failed attempts.
- Overlapping sessions will cause a crash and have to be fixed manually
- Program could crash if Studio ID or Booking time is invalid/not found look here
Using git:
$ git status
$ git pull
TODO: Will implement automatic pulls with webhooks in the future.