Skip to content
Michael Lizzio

RIT Dining Notifications

A Telegram bot that told me how much I could spend on food each day at RIT

  • Python
  • Selenium
  • Beautiful Soup
  • Telegram Bot API
  • JSON

August–September 2024Archived

RIT Dining Notifications cover showing a TigerSpend transaction panel flowing through scrape, save, budget and notify steps to phone alerts
New purchases go in, a daily budget comes out on my phone.
What it is
A Telegram bot that logged into my RIT dining account, grabbed my new purchases and told me how much I could spend on food each day.
Why I made it
RIT gives you Dining Dollars for the whole semester, but the balance doesn't tell you how much you can actually spend today.
What I did
I wrote it in Python with Selenium and Beautiful Soup, and I talked to Telegram's API directly instead of using a library.
How it turned out
It gave me a budget that changed as I spent. The RIT site has changed since then, enough to break it, which is the problem with scrapers.

The details

Why I built it

I wanted a number that changed as I spent. If I spent less than my target one day, I'd have a little more for the rest of the week, and if I went over, the next day's budget would go down. I didn't want to copy every purchase into a spreadsheet to get that.

How it worked

Looping animation of the RIT Notifications Telegram bot showing my name, dining balance, help, budget-check, refresh and Duo-login steps
The bot in August 2024. Only the old connection password is blurred.

I'd send /refresh to the bot. My Python program then opened a browser with Selenium, logged into RIT (I still had to approve the Duo prompt on my phone), opened my dining statement, and read the new purchases with Beautiful Soup.

It saved them to a small JSON file so it never sent the same alert twice, then messaged me each new purchase and my updated budget. /checkfunds just did the math from the saved file without logging in again.

Talking to Telegram

TigerSpend statement showing transaction dates and dining-location descriptions with financial details excluded
The statement the bot read from, with personal details and amounts cut out.

I talked to Telegram's API directly instead of using a library, which made it really clear how a message gets from my phone to my code and back.

Scrapers break

The RIT site has changed since 2024, enough to break a few of the things my code expected, like how dates are written. That's the problem with scrapers: the website changes and your code doesn't. If I rebuilt it, I'd keep my login settings out of the code and add tests with saved pages, so I'd know right away when something breaks.

Loading the dining statement, with personal details removed.