Sometimes you just want to find the nearest supermarket to buy your grocery, or the nearest hawker centre to grab a quick lunch.
SGNearMe Telegram Bot allows you to easily find the 8 nearest places that you are looking for. You can search for the nearest preschools or even the nearest historical sites around you.
The bot is powered by OneMap, a service provided by Singapore Land Authority. The information are contributed and updated by various government agencies
The bot requires location services and can only be used on mobile devices.
- Telegram platform
- python-telegram-bot for managing interaction and integration
- OneMap API for providing places information and maps
-
Selecting a category -
/menu
to manually bring up the categories menu
-
The nearest 8 related facilities will be shown. (Up to ~2.5km - using a 5km square bounding box)
To get a local copy up and running follow these simple steps:
-
Create a new bot and get the bot API token from @BotFather
- Follow the instructions here for a detailed guide
-
Register for OneMap API here
-
Clone the repo
git clone https://github.com/JinHao-L/SGNearMe.git
-
Enter your API in
config.py
# Telegram bot token from BotFather BOT_TOKEN = "ENTER YOUR BOT API TOKEN"
-
Enter your OneMap login details in
config.py
(for auto-updating of OneMap access token)# Login credentials for OneMap email = "ENTER YOUR ONEMAP LOGIN EMAIL" password = "ENTER YOUR ONEMAP LOGIN PASSWORD"
Be careful not to push this config file onto a public platform
-
Start the bot locally by running the python file on the command line
python bot.py
-
(optional) Update the
DEVELOPER_CHAT_ID
inbot.py
by obtaining the id usingupdate.message.chat.id
- This is used for sending error message to the developer
Read up on Getting started on Heroku with Python or Deploying Telegram Bot using Heroku
Distributed under the MiT license. See LICENSE
for more information