GithubHelp home page GithubHelp logo

nuffield-cli's Introduction

nuffield-cli

A set of command-line to make it easier to book Nuffield Health gym classes.

Why (start with why)

With Nuffield Health booking system (https://www.nuffieldhealth.com/account/homepage), you usually have to book 8 days in advance at 7 am to be sure to have space in your classes.

It is not ideal since:

  • you need to book several times a week if you attend several classes,
  • if you forget to book at 7am, the class might be full.

With nuffield-cli:

  • you can book all your classes for the next few weeks in one day,
  • you will be the only one not to have the 8 days limitation, so you can be the first one to book all your classes.

Configuration

You need to find your gym id, your member id and your Auth-Token (it will expire regularly, so you will have to repeat this procedure regularly):

# Check what you have in place of YOUR_GYM_ID_HERE / YOUR_MEMBER_ID / YOUR_AUTH_TOKEN_HERE:
curl 'https://nuffield.bookingbug.com/api/v1/YOUR_GYM_ID_HERE/basket/checkout' -H 'Origin: https://www.nuffieldhealth.com' -H 'App-Key: f0bc4f65f4fbfe7b4b3b7264b655f5eb' -H 'Accept-Language: en-GB,en;q=0.9,en-US;q=0.8,fr;q=0.7' -H 'App-Id: f6b16c23' -H 'Accept-Encoding: gzip, deflate, br' -H 'Connection: keep-alive' -H 'Pragma: no-cache' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36' -H 'Content-Type: application/json' -H 'Auth-Token: YOUR_AUTH_TOKEN_HERE' -H 'Accept: application/hal+json,application/json' -H 'Cache-Control: no-cache' -H 'Referer: https://www.nuffieldhealth.com/gyms/city/timetable' -H 'DNT: 1' --data-binary '{"client":{"id":YOUR_MEMBER_ID}}' --compressed

Requirements

  • Instructions for Ubuntu:
# Install jq (Command-line JSON processor)
sudo apt install jq
  • Instructions for Mac OSX:

Using Homebrew (For details about installing homebrew, see http://brew.sh):

brew install jq

Usage

A sample script is provided: book-my-classes:

# Edit the script with your ids and with the classes that you want to book and execute it every 2 weeks
vi book-my-classes

# Edit the script book-my-classes and then execute:
./book-my-classes -s "2019-01-21"

# Or specify another date, e.g. Monday in 2 weeks (Next Monday + 1 week):
./book-my-classes -s "Monday + 1 week"

Or feel free to use directly the command line tools:

# Print usage
./list-classes -h
./filter-classes -h
./book-class -h

# List all the classes available to book on 01/01/2019
./list-classes -g 1234 -d "2019-01-01" -b

# Book the Yoga class at 06:35 on 01/01/2019
./list-classes -g 1234 -d "2019-01-01" -b | ./filter-classes -n "YOGA" -t "06:35" | ./book-class -a "AnUjfgrTyuihfTgjklMkdd" -g 1234 -m 123456

# Book any Yoga class on 01/01/2019
./list-classes -g 1234 -d "2019-01-01" -b | ./filter-classes -n "YOGA" | ./book-class -a "AnUjfgrTyuihfTgjklMkdd" -g 1234 -m 123456

nuffield-cli's People

Contributors

hubertlacote avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

scotthooker

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.