A simple Telegram Bot implemented in Node.js using Express 4 and a few libraries to help you view bus arrival timings of Singapore's Public Transport. https://telegram.me/sgbustimebot
Refer to Telegram Bot and Telegram Bot API
This is a 10 years old project (as of April 2026), hence it probably could not run anymore. The source code is made open source to serves as a reference of how my software development style has evolved across time. But if you still wish to copy or fork it, use it at your own risk.
Make sure you have Node.js installed. My personal preference would be to use NVM to install multiple versions of Node.js if you are using OS X or Ubuntu. If you are using Windows, can consider nvm-windows.
$ git clone git@github.com:xkawi/sgbustimebot.git # or clone your own fork
$ cd sgbustimebot
$ cp config.sample.json config.json # replace config information with yours
$ npm install
$ npm start
Your app should now be running on localhost:5000. This just ensure that your code is working fine and has no error. To start receiving and responding to user's commands (Telegram Users), please deploy it to the Internet. You can deploy it anywhere and anyhow so long you know how to deploy Node.js applications. Here are some references:
- Getting Started with Node.js on Heroku
- How To Set Up a Node.js Application for Production on Ubuntu 14.04
- Tutorial: How To Deploy NodeJS Applications, With Examples
- Build and deploy a Node.js web app in Azure App Service
Thanks for the great work by cheaun/busrouter-sg for providing a tool to retrieve all the available bus stops in Singapore.
Please note that, all of the actual data such as routes, bus stops, bus arrival timing and services are taken from http://mytransport.sg/, which means they are copyrighted by the Land Transport Authority.
If anyone interested to built on top of this source code, feel free to fork it and create pull request if you want to.
PS: if you encounter any issue specific to installation process, please consult their own documentation.