With pandemic measures in place, gyms everywhere have taken precautions to only let a small number of people work out at a time. My gym in particular did this using a website or mobile app, that allows members to book slots. Each days’ slots were opened up for booking exactly a week before the booking day, so the slots for October 14th are opened at midnight on October 7th for example.

The timing that bookings opened was really annoying for me because I typically go to bed at around 10.30pm and when I’m up at 6.30am, all the slots are booked! I didn’t want to have to wait until midnight every night to do the booking, so I decided to find a way to automate the process.

Investigation

First off, I had to do a bit of digging to figure out if this is even possible. I popped open the developer tools in my browser and checked what happens when I made a booking.

Image for post

Booking POST Request

After hitting the book button, I saw this POST request that does the booking. Great! Looking closer at the request

Image for post

#api #fitness #nodejs #javascript #hacking

Hacking My Gym With Node.js
2.40 GEEK