I've been using hacker news for a while but one of the things I started wanting recently was the ability to have alerts for any stories I post.
The thing that pushed me over the edge was Hackclub's shipwrecked https://shipwrecked.hackclub.com/ (hackathon in the boston bay for anyone that can make 4 projects over the summer and get at least one of them to go viral). One of the options for "going viral" was to get to the front page of hacker news but I was constantly scared that I would miss it getting on there lol so I whipped up a quick slackbot to send alerts to a channel. It was dead simple but it did work.
Once I had the bot I realized I could do wayyyy more with the data I was collecting so I decided to add some historical data initially thinking I would generate graphs and then embed them in the message but decided to quickly try using Bun.serve to host a quick dashboard mainly since I wanted to see how the developer experience was. Spoiler it is amazing. I've gotten really inspired by web components and the idea of only using universally supported `html`, `css`, and `js`. Bun results in an amazingly nice developer experience where you can just import the `index.html` and assign it to your root route and be done. Sorry for shilling about bun but it truly was one of my favorite parts of building this besides drizzle.
The dashboard has a graph of the points earned and position on the leaderboard over time (updated every 5 minutes) and then the expected stats like peak points, peak position, author, and comment count.
Also btw all the code is open source ofc on both my tangled repo (https://tangled.sh/@dunkirk.sh/hn-alerts) as well as a github repo (https://github.com/taciturnaxolotl/hn-alerts) and you can try the hosted version at https://hn.dunkirk.sh I'm planning to add the ability to just install the slackbot to any workspace and have workspace specific leaderboards but that will require a bit of refactoring and probably abandoning the slack-edge package.
Also you can view specific item's data by simply replacing news.yc.com with hn.dunkirk.sh like: https://hn.dunkirk.sh/item?id=44115853
NAHWheatCracker•1d ago
It would be nice if the chart would move down or something when you select a post that's lower in the rankings. I had to scroll back to the top after clicking one of the bottom posts.
clacker-o-matic•1d ago
leoff•1d ago
1. add `position: relative;` to `main-container`
2. add `position: sticky; top: 0;` to `graph-container`
you need to figure out what to do in the mobile display though
clacker-o-matic•1d ago