- 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
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.
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.


