Script to automatically book a tennis court (on https://tennis.paris.fr)
"Par ici" mean "this way" in french. The "Parisii" were a Gallic tribe that dwelt on the banks of the river Seine. They lived on lands now occupied by the modern city of Paris. The project name can be interpreted as "For a Parisian tennis, follow this way"
NOTE: They recently added a CAPTCHA during reservation process. The latest version should pass through. If it fails, open an issue with error logs, I will try to find an other way.
- Node.js >= 20.6.x
- A "carnet de réservation" in your Paris Tennis account (see Payment process)
Create config.json file from config.json.sample and complete with your preferences.
location: a list of courts ordered by preference - full list
You can use two formats for the locations field:
- Array format:
"locations": [
"Valeyre",
"Suzanne Lenglen",
"Poliveau"
]Use this if you want to search all courts at each location, in order of preference.
- Object format (with court numbers):
"locations": {
"Suzanne Lenglen": [5, 7, 11],
"Henry de Montherlant": []
}Use this if you want to specify court numbers for each location. An empty array means all courts at that location will be considered.
Choose the format that best matches your preferences.
-
datea string representing a date formated D/M/YYYY, if not set the date 6 days in future is used -
hoursa list of hours ordered by preference -
priceTypean array containing price type you can bookTarif pleinand/orTarif réduit -
courtTypean array containing court type you can bookDécouvertand/orCouvert -
playerslist of players 3 max (without you)
You can configure the script to send notifications with the reservation details and the ics file via ntfy, a simple pub-sub notification service.
To receive notifications:
- Choose a unique topic name (e.g.,
YOUR-UNIQUE-TOPIC-NAMEchoose something unique to avoid conflicts and complex because there is no password for subscription) - Subscribe to your topic using the ntfy mobile app or web interface
To enable ntfy notifications in script, add the following configuration to your config.json:
"ntfy": {
"enable": true,
"topic": "YOUR-UNIQUE-TOPIC-NAME"
}Configuration options:
enable: set totrueto enable ntfy notificationstopic: your unique ntfy topic name choose previouslydomain(optional): custom ntfy server domain (ntfy.shused if empty)
Notification example:
To pass the payement phase without trouble you need a "carnet de réservation", be carefull you need a "carnet" that maches with your priceType & courtType combination selected previously
To run this project locally, install the dependencies
npm installand run the script:
npm startTo test your configuration, you can run this project in dry-run mode. It will check court availability but no reservations will be made:
npm run start-dryYou can start script automatically using cron or equivalent
Contributions and bug reports are welcome! Please open an issue or submit a pull request.
MIT
