Inspiration

As residents of NUS University Town Residential College, we have had bad encounters with Dining Hall meals. While we are able to check the daily menu for breakfasts and dinners, we cannot check the oishi-ness of the meal. Hence, we decided to add-on to the existing Telegram RC Meal Bot.

What it does

DH Food Bot takes a step further than the RC Meal Bot by implementing a rating system that allows Telegram users to rate the meals from 1-5. Other users will then be able to see the ratings of a particular food cuisine (e.g. Western) and better plan for their meals.

How we built it

As we are unable to access the RC Meals Menu Database, we scraped the source code for the menu from the Office of Housing Services (OHS) website and imported the data to Telegram. Thereafter, we used the concept of polling to design our rating system. Finally, we added a function to allow users to view the average ratings for each cuisine.

Challenges we ran into

As our team is new to programming, there were a lot of codes that we could not understand. The biggest challenge we faced was scraping the source code from the OHS website and implement into Telegram as we had to convert html scripts into readable Python interface. With much experimenting and searching, we managed to convert the tags.

Accomplishments that we're proud of

We managed to finish our program in Python, which is a new language for most of us.

What we learned

We don't really need to know Python to code in Python. Knowing the implementation of the API(python-telegram-bot) is way more important than knowing the syntax of python. The intricacies of web scraping and its interaction with AJAX and javascripts in the scraped webpage.

What's next for DHbot

DH Food Bot currently allows users to pick the cuisine that they want to rate, which may lead to users falsely rating for other cuisines. As there is no definitive way to see what cuisine someone picked due to the nature of the food ticketing system, we will need ways to confirm the cuisine someone picked, such as having a scanning machine for each cuisine instead. The machine will then inform the Telegram database which cuisine was picked, and automatically link the user to rate for that cuisine only.

Built With

Share this project:

Updates