Giter Club home page Giter Club logo

gymbox-bot's Introduction

gif

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:

{
  "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:

{
  "2017-06-21": {
    "className": "Gymnastic Conditioning",
    "time": "12:15",
    "location": "Farringdon"
  }
}

Format for classesByDay.json is:

{
  "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

gymbox-bot's People

Contributors

alex3165 avatar felixng avatar ricard0javier avatar timgent avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.