Code Monkey home page Code Monkey logo

drivetest-ca-availabilities's Introduction

drivetest.ca availabilities

This is no longer being maintained

This CLI tool written in Node.js will log in to Ontario's driving test booking system, search for all the available dates and times for all locations within a given search radius (default is 20km). Once it finds some available times, it will write them to the terminal.

I worked on this tool during some of my spare time because I found it difficult to find open spots for driving tests due to the way the website was designed. It uses Puppeteer to walk through the website and extract information as if it was a regular user (with some rate-limiting as to not overload the website with requests).

Buy Me A Coffee

Using the prebuilt binary

You can find a prebuilt binary in the Releases section with a list of the options below that you will need to pass (the ones that have a default are optional).

On the first run, the script will download a compatible version of Chrome/Chromium to retrieve the information but after that, it'll reuse the downloaded instance (unless I decide to use an updated revision in a future update).

$ .\drivetest-availabilities-win.exe -h
$ ./drivetest-availabilities-linux -h
$ ./drivetest-availabilities-macos -h

Usage: cli [options]

Options:
  -r, --radius <radius>            search radius in kilometers from where you are (default: 20)
  -l, --location <location>        your current location expressed in "latitude,longitude" (eg.
                                   43.6426445,-79.3871645).
  -m, --months <months>            Number of months to look ahead (default: 6)
  --licenseType <licenseType>      License type exam to search for
  --email <email>                  Email to log in with
  --licenseNumber <licenseNumber>  License number to log in with
  --licenseExpiry <licenseExpiry>  License expiry date expressed in "YYYY/MM/DD" to log in with
  --chromiumPath <chromiumPath>    Path to Chromium-based browser executable. If option not used, Chromium will be downloaded to this folder.
  -h, --help                       display help for command

Building from source

Prerequisites

  • Node.js 14+ (active LTS at time of writing)
  • yarn classic (npm can be used but yarn is recommended since there's a yarn.lock file included)

Steps

  1. Install necessary dependencies by running yarn install
  2. Compile the Typescript files to Javascript by running yarn build
  3. Rename config.json.example to config.json, fill in all the empty fields and remove the comments from the file. However, if you want to pass the details manually as CLI arguments, you can leave the fields empty.
  4. Start the script by running yarn start and passing in the required arguments (and any optional ones, if you wish)

Creating your own executables

After following the steps above, if you wish to create your own executable off of this, just run yarn package.

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.