The Doctolib Appointment Finder is a Node.js application which checks for available appointments for a specific doctor on Doctolib and notifies you via a Slack message if there's an available appointment within a given timespan. It also gives an option to automatically stop checking once an appointment is found.
- Clone the repository:
git clone [email protected]:renekann/doctolib-appointment-finder.git
. - Install dependencies:
yarn install
. - Copy
.env.example
to.env
and set your environment variables.
yarn start
- Build the Docker image:
docker build -t doctolib-appointment-finder .
- Run the Docker image:
docker run -p 3000:3000 doctolib-appointment-finder
.
The configuration is done using environment variables, which can be set in the .env
file. The following variables are required:
APPOINTMENT_URL
: URL of the doctor's appointment availabilities. This can be extracted from the doctor's booking page.TIMESPAN_DAYS
: The timespan in days within which an appointment should be searched for.SCHEDULE
: A cron expression that defines how often the availability of appointments should be checked.SLACK_WEBHOOK_URL
: The URL of your Slack incoming webhook. This will be used to send notifications.DOCTOR_BOOKING_URL
: The URL of the doctor's booking page. This is optional, but can be used to provide a direct booking link in the Slack notification.STOP_WHEN_FOUND
: (optional) If set to 'true', the script will automatically stop checking for new appointments once an appointment is found. Default is 'false', which means the script will keep running and checking for appointments even after one is found.
The APPOINTMENT_URL
should be extracted from the availabilities.json
request on the doctor's booking page. Note that there may be multiple availabilities.json
requests, you should select one that contains start_date
in its URL.
Follow these steps to extract the APPOINTMENT_URL
:
- Open the doctor's booking page in your web browser.
- Open the Developer Tools (typically
F12
orCtrl + Shift + I
). - Go to the Network tab.
- Reload the page.
- In the filter box, type
availabilities.json
. - From the list of
availabilities.json
requests, find the one whose Request URL containsstart_date
. - Click on that
availabilities.json
request in the list. - Copy the Request URL. This is your
APPOINTMENT_URL
. Thestart_date
value in the URL will be replaced with today's date when the script runs.