Simone's Blog (no JS mode)

The Bluesky Firehose is cool!

butterfly flying under the title

I've been using Mastodon (specifically Hachyderm) for the past two years. I left Twitter, deleted all my tweets and turned off the lights on my way out. Mastodon is great; there are so many smart people, and it feels like the platform can shield itself from spam attacks while offering excellent moderation tools. However, apart from the obvious UX issues, in my humble opinion, it never really took off the way Bluesky is doing at this very moment.
Many accounts that migrated from Twitter have been treating Mastodon as a place to appease the part of their audience upset with Elon. I rarely saw artists or content creators actually only posting on Mastodon, but rather they'd crosspost the same tweet or bridge it with some nerdy tool. Now, to be fair, this is still happening with Bluesky. There's nothing wrong with that, but the FOMO has always been there. I quite often found myself lurking on Twitter again to check in on those who didn’t migrate elsewhere, and I still came across plenty of tweets and original content being posted.

I use internet to get inspired, this is the engine that drives my side projects and that shaped my career. Since the days of forumcommunity.net (a well known Italian forum provider) I’ve enjoyed exploring people’s web creations and discovering interesting links. Twitter was a wonderful place for that. Over the last 14 years, I followed so many talented developers and learned so much from their experiences and rants, it was always cool to see what they were building. Twitter was mostly text and links, with occasional images and videos. Bots were fun, APIs were amazing, and it felt like the platform was truly yours. The truth is, I can live without any of these microblogging platforms, but occasionally, I do want to yell at clouds!

bluesky firehose 3d visualization

Alright, the preamble ends here. About a month ago, I decided to give this Bluesky a try, and against all odds, I’m really enjoying it. Somehow, I even stopped going back to Twitter altogether; the vibes on Bluesky are just so much more relaxed. I’m not sure why, but these social media mass migrations always seem to happen in November for some reason!
Anyway, what primarily caught my attention was Bluesky's tech stack and its simplicity as I studied and experimented with it. Over the past year or so, developers have integrated ATProto into their web apps and blogs, and it’s fascinating to see how much can be achieved with it. One project, in particular, set me on this path: firehose3d. It’s essentially a 3D visualization of Bluesky's firehose, a continuous real-time stream of all Bluesky's tweets. And yes, I’m going to call them tweets because I don’t have the mental capacity to learn yet another word for the exact same concept.

After discovering more and more projects like this, I thought: why not use the firehose to display all these tweets as an endless Matrix-style digital rain? I mean, the metaphor kind of lends itself perfectly in this context. Within a couple of days, I sketched out a quick and dirty proof of concept and deployed it on GitHub Pages. And that's how Bluerain went up and running. After spamming it in a few places around the web, I received lots of great feedback and comments. It made me so happy to see that people genuinely appreciated this small artistic thingy.

bluesky firehose matrix style

Under the hood, the web app is quite straightforward. I collect as many tweets (from a Jetstream server) as there are empty columns available on screen, calculated based on font style and size. I then wrote an algorithm loosely inspired by this CodePen, which uses the Canvas APIs to fill each column with the iconic digital rain cascading from the top of the screen. If a tweet isn’t fully rendered by the time it reaches the bottom edge, the remaining part of the message reappears at the top of the same column and continues until it’s fully displayed. When a tweet has finished rendering, the column is freed up and waits for the firehose to fill it with a new tweet. The Jetstream service was incredibly handy to work with, as reading directly from the firehose would have required some decoding shenanigans, which I wanted to avoid for such a small JavaScript app.

The feature that was most fun and interesting to implement was the new posts filtering. I got the inspiration from this now dead web app. With the post filtering feature, you can specify particular words and hashtags you want to see in tweets. As new tweets flow in from the firehose, only those containing the specified words will appear in the digital rain! It was fascinating to see which words, and most importantly, people’s names, appeared most frequently...
For instance, here's how many people are tweeting about Christmas 🎄 🎅 at the moment I was capturing this video. I highly recommend giving it a try.

This small app was incredibly entertaining to create, and I had many wow moments, which is why I decided to include it in my official list of projects I enjoyed developing. For an even more immersive experience, you can turn on the digital rain sounds I sampled directly from the movies using Audacity — perfect if you're into some Matrix ASMR to help you sleep or something!

Posted on 24 December 2024