An open API service indexing awesome lists of open source software.

https://github.com/hfroot/titre-de-sejour


https://github.com/hfroot/titre-de-sejour

Last synced: 11 months ago
JSON representation

Awesome Lists containing this project

README

          

# Availability checker

## Context

Once your titre de séjour is ready, you have to book an appointment from your local préfecture to pick it up.

## The problem

I found the website of my local préfecture frustrating to use because it is slow and the form is structured such that to check all availability you need to make around 20 clicks\*. You may also encounter a 503. The new appointments are not released on a schedule, so I was advised to check the website randomly a few times a day for as many days as it might take for my luck to come through. As a developer I have developed a (healthy?) distate of repetitive tasks so I thought: why not automate this?

\* The clicks involved:
1. agreeing to some terms
2. choosing 1 'desk' out of 8 to check the availability of
3. discovering there is no availability at the chosen desk, being redirected to step 1.

## The solution

This script uses a front end testing tool, Playwright, to click through all the options and confirms availability or lack thereof in the console.

I considered creating a Twitter account and run this script a couple times a day automatically to inform others when there are available appointments, but I did not get accepted for a developer account.

I would've automated running it personally if necessary, but managed to get an appointment after a few times of using it.

### The details

The script clicks through the site and prints to the console the status of each desk. If it encounters a 503, it cuts the program, to be run at a later time.