redditing-buddy

|

Programming external GitHub link


Description๐Ÿ”—

redditing-buddy is a bot that checks for posts matching specific queries in various subreddits of your choosing, and pings you on Discord when it finds something new. This bot was originally created to check r/forhire for new job postings every few minutes.

Method๐Ÿ”—

The bot consists of a Monitor which acts as a broker between a Redditor and a DiscordMessenger. The Monitor sets an interval clock to tell the Redditor to check Reddit on each tick, and if anything new comes back then it sends it off to the DiscordMessenger to be sent to the user. diagram

Points of interest๐Ÿ”—

UX๐Ÿ”—

I'm rather happy with the UX of the command line interface. The configuration format and the time parser together make using the tool rather easy, I think. There isn't really anything technically complex about it, but I think it's important that the usability is good when creating a tool that could potentially have uses for other people than just yourself.

Things I learned๐Ÿ”—

Making a good configuration file is hard๐Ÿ”—

I chose to use the RON file format for my configuration file, as it allowed me to get closer to the underlying Rust structs. This seemed like a good idea at the time because it allowed me to iterate quickly on the config format as my needs changed during the development process; however, in hindsight, it actually presented a pitfall in that it coupled the config file too tightly with the underlying implementation. While this was convenient for me as a developer, it made usability unintuitive, so I spent a while refactoring the config so that it was easier to understand without having to know the underlying code structure. In the end I think the config format turned out alright, but had I designed it from the start with usability in mind, I could have saved myself the effort of the refactor.