Ever wanted to play badminton at a certain time? Have you tried looking at court reservations on https://bintangbadminton.org/court-reservations/? If yes, you've probably seen this:
No experience parallels looking for courts and when they're free, only to click through this nightmare: 😱🙀
That's OK, with a few easy steps, you can be viewing court schedules with buttery smoothness:
Steps below are for Python 3, but it should work for Python 2 as well. To get your Bearer Token, follow steps in Getting the Bearer Token.
git clone https://github.com/teoh/bintang-buddy.git
cd bintang-buddy
python3 -m venv venv
source venv/bin/activate
pip3 install -r python/requirements.txt
export BEARER=<your bearer token>
The steps are straightforward and very human.
Try running the commands below:
cd bintang-buddy
python3 python/bintang_schedules.py -d "20220113" -g "san carlos" -g "sunnyvale"
This script has two arguments:
-d
: Date string, in the form ofYYYYMMDD
-g
: The names of the gyms you'd like to load court schedules for. If you leave this empty you'll get every court for every gym, and you'll be waiting for a while. Your choices:campbell, dublin, milpitas, san carlos, sunnyvale
I hate this step, I wish I didn't have to include it, but pasting tokens on a public repo didn't seem like a good idea. Steps below:
- On Chrome, go to https://bintangbadminton.org/court-reservations/
- Scroll to the bottom and look for this:
⌥+⌘+I
to open developer tools- On the developer tools, click the "Network" tab:
- Do
⌘+E
to clear the network history - Click any court on the left, e.g. Campbell Courts:
- Some requests should show up on the right:
- Keep clicking around the list until you see a
Request URL
that starts withhttps://app.bukza.com/api/
: - Scroll down to
Request Headers
and copy the long text beside "Bearer". This is your Bearer Token: