Skip to content

A Python bot that reserves the earliest available time slot at Fitness@MIP and creates an event on Google Calendar

License

Notifications You must be signed in to change notification settings

grantwforsythe/gym-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gym Reservation Bot

Overview

A bot that reserves the earliest available time slot at Fitness@MIP and makes a note of the event in a Google Calendar.

Set Up

Unix/Linux

To implement this, clone this repository and follow the steps below:

  1. Download the Firefox webdriver, geckodriver, and have it on your PATH
$ 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/
  1. Create environment variables
$ export EMAIL=your-email@gmail.com
$ export PASSWORD=your-password
$ export DRIVER=/path/to/geckodriver
  1. Follow this guide to access Google's Calendar API and move credentials.json to the root of this repository
  2. Install the dependencies
$ python3 -m venv venv && source venv/bin/activate
(venv) $ pip3 install -r requirements.txt
  1. Run the program
(venv) $ python3 -m bot
  1. (Warning) If met with a 403 when trying to access your calendar, refer to this thread
  2. (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

Docker

  1. Update ENV variables
ENV EMAIL=your-email@gmail.com
ENV PASSWORD=your-password
  1. Build the image
docker build -t gym-bot 
  1. Create a container
docker run -ti gym-bot

Configuartion Options

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

About

A Python bot that reserves the earliest available time slot at Fitness@MIP and creates an event on Google Calendar

Topics

Resources

License

Stars

Watchers

Forks