Please sign in to access this page

Converge Monitor

Converge Monitor Used AI

2 devlogs
12h 3m
•  Ship certified
Created by GGORG

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.

Timeline

Ship 2

0 payouts of shell 0 shells

GGORG

1 day ago

GGORG Covers 1 devlog and 1h 36m
GGORG
GGORG
1h 36m 23 days ago

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!

Update attachment

Ship 1

1 payout of shell 26.0 shells

GGORG

about 1 month ago

GGORG Covers 1 devlog and 10h 26m

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.

Update attachment