https://github.com/alex3165/gymbox-bot
Simplify the booking of a gymbox class.
https://github.com/alex3165/gymbox-bot
cli cron gymbox nodejs schedule
Last synced: about 1 year ago
JSON representation
Simplify the booking of a gymbox class.
- Host: GitHub
- URL: https://github.com/alex3165/gymbox-bot
- Owner: alex3165
- Created: 2016-11-23T19:20:01.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T18:17:02.000Z (over 3 years ago)
- Last Synced: 2024-04-14T12:29:19.435Z (about 2 years ago)
- Topics: cli, cron, gymbox, nodejs, schedule
- Language: JavaScript
- Homepage:
- Size: 782 KB
- Stars: 23
- Watchers: 5
- Forks: 12
- Open Issues: 11
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README

# Gymbox bot
Provide you a complete experience to automate booking of your gymbox classes:
- API: Add class to book
- Scheduler: Cron to run on your server to check class to book everydays at 7am
- Cli: Book a class using command line
## How to make a booking
First you need to add your `email` and `password` into a `./data/config.json`, example:
```json
{
"email": "YOUR_EMAIL_HERE",
"password": "YOUR_PASSWORD_HERE"
}
```
Secondly you need to add the class you want to book to either the `./data/classes.json` file, using the date as the key,
or for recurring bookings by adding the class you want to book to the `./data/classesByDay.json` file. Format for
classes.json is:
```json
{
"2017-06-21": {
"className": "Gymnastic Conditioning",
"time": "12:15",
"location": "Farringdon"
}
}
```
Format for classesByDay.json is:
```json
{
"Monday": {
"className": "Gymnastic Conditioning",
"time": "12:15",
"location": "Farringdon"
}
}
```
### Using the cli
```
node cli.js -c run
```
### Using the scheduler
> Edit cron expression in `scheduler.js` then:
```
node scheduler.js
```
## How to use the API
```
node api.js
```
Endpoints:
- GET: `/api/table`: return the gymbox time table
- Query params:
- `email`: Gymbox user email
- `password`: Gymbox user password
- GET: `/api/add`: Add a class to book
- Query params:
- `email`: Gymbox user email
- `password`: Gymbox user password
- `className`: The name of the class to book
- `time`: The time of the class to book, format: HH:mm
- `date`: The date of the class to book, format: YYYY-MM-DD
- `location`: The gym location of the class to book