A bot that reserves the earliest available time slot at Fitness@MIP and makes a note of the event in a Google Calendar.
To implement this, clone this repository and follow the steps below:
- Download the Firefox webdriver,
geckodriver
, and have it on yourPATH
$ wget https://github.com/mozilla/geckodriver/releases/download/v0.29.1/geckodriver-v0.29.1-linux64.tar.gz
$ tar -xvzf geckodriver*
$ chmod +x geckodriver
$ sudo mv geckodriver /usr/local/bin/
- Create environment variables
$ export EMAIL=your-email@gmail.com
$ export PASSWORD=your-password
$ export DRIVER=/path/to/geckodriver
- Follow this guide to access Google's Calendar API and move
credentials.json
to the root of this repository - Install the dependencies
$ python3 -m venv venv && source venv/bin/activate
(venv) $ pip3 install -r requirements.txt
- Run the program
(venv) $ python3 -m bot
- (Warning) If met with a
403
when trying to access your calendar, refer to this thread - (Optional) To automatically run the bot, edit scripts.sh and schedule a
cronjob
" runs every Mon-Fri at midnight
0 0 * * 1-5 bash /path/to/scripts.sh
- Update
ENV
variables
ENV EMAIL=your-email@gmail.com
ENV PASSWORD=your-password
- Build the image
docker build -t gym-bot
- Create a container
docker run -ti gym-bot
Here is a list and description of the different arguments to use for the bot:
- --headless : Run the bot in headless mode
- --add-event : Create an event in Google Calendar