Please sign in to access this page
A monitor Slack bot for the Converge YSWS ( https://converge.hackclub.com/ ), similar to #som-monitor. It scrapes the YSWS's website every 5 minutes and posts a message to #converge-monitor every time a change is detected.
Tymek
Check their projects out: Agin CI, Agin Auth, Wasona, Agin Sensors, Agin Slides
Realzzy
Check their project out: Suspy - Link moderation made easy
Once you ship this you can't edit the description of the project, but you'll be able to add more devlogs and re-ship it as you add new features!
So, the Emporium (https://emporium.hackclub.com) opened, and had different rewards than the Converge website (https://converge.hackclub.com).
That means... A complete rewrite of the scraping portion of the bot. I deleted all the code responsible for parsing the ESTree, because the Emporium website is made with SvelteKit. That makes it SO MUCH easier to deal with, as it's server side rendered. That means I only have to request the URL with the correct cookie and I get ALL the HTML. Then a quick walk with the scraper crate and we're done!
Now instead of... many lines of code to painfully traverse the 20MB ESTree, the entire scraping logic is just around 50 lines of well-formatted Rust code!
So this was my first ever Slack bot! And, of course, I decided to make it in Rust - turns out there is a great crate called slack_morphism for that!
The majority of the time was spent on reverse engineering the Abstract Syntax Tree (ESTree) of the compiled JavaScript bundle of the converge.hackclub.com website - that means parsing a 20-megabyte JSON file! Fortunately, Rust is pretty fast at that.
My code tries to find the React entrypoint (root element), and then locate 3 arrays in the source code that define the YSWS's rewards and supported chat platforms.
Then came the easy part - the actual Slack bot. It scrapes the Converge website every 5 minutes, compares the parsed results to the previous query, and if they differ, posts a neatly-formatted message to #converge-monitor.
At the end I added support for pinging the usergroup after every detected change, to make following the updates easier.