Giter Site home page Giter Site logo

wodbooker's Introduction

WodBooker - The WodBuster AutoBooker

This Flask application allows WodBuster users to create booking requests which will be performed on their behalf as soon as possible.

Users has to authenticate with the app using their WodBuster credentials. The app will check this credentials with WodBuster and will allow users to sign in only when the credentials are valid.

Once logged in, users are allowed to create booking requests. To do so, they are required to introduce:

  • Day of week: The day of the week the booking is intended to.
  • Hour: The hour of the day the booking is intented to.
  • WodBuster box URL: Every box has a different WodBuster URL. Users are required to introduce the one specific to their box. This is required for users with access to multiple boxes.
  • Days in advance: The number of days in advance with which the class can be booked.
  • Booking opening hour: The time of the day when the first booking attempt should be executed.

Once the request is created, a thread will take care of it by:

  1. Waiting for the booking is available taking into account "Days in advance" and "Booking opening hour" parameters
  2. Attempting the booking when the booking is supposed to be ready
  3. If the day has not been loaded, the thread will connect to the SSE (Server Side Events) server to listen until the classes have been loaded.
  4. If the day has been loaded but booking is not available yet, the thread will wait unitl the class is available.
  5. Once the booking has been performed, the thread will execute the whole process again for the same day of the next week.

In order to avoid CloudFare restrictions it's highly recommended to create an entry in your /etc/hosts file pointing wodbuster.com to the final WodBuster server.

Webapp

Run the app by just running:

python3 app.py

GCP Cloud Run

gcloud builds submit --tag gcr.io/$GCLOUD_PROJECT/wodbooker . && \
gcloud run deploy wodbooker \
    --image gcr.io/$GCLOUD_PROJECT/wodbooker \
    --port 5000 \
    --region europe-west1 \
    --platform managed \
    --allow-unauthenticated \
    --quiet

Running locally (raspberry pi)

Requirements

Install docker

Setup

Build images, create docker network

docker network create net
docker build -t nginx-wodbooker ./nginx/Dockerfile
docker build -t wodbooker .

Run containers:

docker run --rm -p 5001:5001 --network=net -e EMAIL_PASSWORD=${EMAIL_PASSWORD} -v $(pwd):/app --name wodbooker wodbooker
docker run --rm --name nginx-wodbooker  --network=net -p 80:80 nginx-wodbooker

wodbooker's People

Contributors

aitormagan avatar xmsanchez avatar ajmorenodelarosa 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.