Automated Bukit Batok Driving Centre (BBDC) Booking System

Zing Zai
3 min readSep 16, 2019

No longer actively support this project.

Outcome

You will build your own app that:

  1. Periodically log in to BBDC to check for available slots for pre-defined days and sessions
  2. Performs booking automatically if an available slot matches your criteria
  3. Alerts you through Telegram when the slot has been booked

Impetus

BBDC practical slots are always fully booked… and when it gets released (usually 1–2 days prior to the practical lesson), it is always a matter of luck whether you’ll be able to log in in time and book it before it gets booked away by some other student stalking the website.

There were a couple of resources that does BBDC booking automation. However, I found that there was some level of code understanding / configuration required.

Today I’ll share with you how YOU can deploy your own BBDC auto-booking system. No coding involved, just some simple config and you are good to go!

Prerequisites

  1. BBDC account (DUH…)
  2. Sufficient balance in your BBDC account
  3. Telegram Account

Step 1: Create a Telegram Bot to receive updates

First you have to create your Telegram Bot. You need a Telegram Bot to send you updates. You need to retrieve your (1) Bot Token and (2) chat_id.

Telegram Bot commands
  1. Search and send message to BotFather.
  2. Type in the commands as seen above.
    (/newbot, <CUSTOM BOT NAME>, <CUSTOM BOT USERNAME>)
  3. Create a Telegram Group and invite your Telegram Bot into the group. Your Telegram Bot will use send updates on this group later.
  4. Copy and paste your Bot Token and replace it in this link, https://api.telegram.org/bot<YourBOTToken>/getUpdates.
    (i.e.https://api.telegram.org/bot982393737:UNVUNVUV2983293IJDFIJAF82982bjdfh/getUpdates)
  5. Visit the link above and you will get a response. Copy and paste the chat_id in the response.
    *(i.e. {“id”:-XXXXXXXXX, ”title”:”asdf”,”type”:”group”,”all_members_are_administrators”:true},”date”:1568560744,”group_chat_created”:true}}]})
    *The minus sign is also part of the chat_id.
  6. Ensure you have your (1) Bot Token and (2) chat_id.

Step 2: Deploy App onto cloud platform

Next, you need a Heroku account. You need a Heroku account to host your Bot.

Deploy project on Heroku
  1. Sign up for a Heroku account.
  2. Go to my Github page, make a copy and deploy the project on Heroku.
  3. After the project has been successfully deployed, click on Manage App.
Config Vars sample

4. Under Settings, reveal Config Vars and enter the configs above.
I have externalised sensitive configurations so that you can enter it yourself through the Heroku interface. This way, you can be sure that I am not collecting any of your info.

5. As soon as you have inserted the configs, you will receive updates through your Telegram Bot.

6. The app will periodically log in to BBDC website…

7. Optional: You can go to More > View Logs to see what your app is doing behind the scenes!

Acknowledgments

SKAshwin: Forked this Github project and tweaked it to fit my use case:
* Externalised configurations
* Occasionally pinged hosted Heroku app to prevent it from idling
* Created a one-click deployment onto Heroku
* Wrote guide to create Telegram Bot and deploy app onto Heroku
* Applicable for new Oct 19 BBDC website

Support

Sept 19: No longer actively support this project.
Jul 20: Removed active session variable from code base; Tested and working.

--

--