π Likes - A decentralized social network in a single HTML tag
"Everything is made up and the points don't matter."
- Drew Carey, Who's Line Is it Anyway?
Just click like:
How?
WTF
Any GET
request to https://likes.catskull.net
will return an SVG with the number of likes for the URL in the Referer
[sic] header. This page is rendered if no URL is present.
Any POST
request to https://likes.catskull.net
will increment the number of likes for the Referer
URL and return an SVG with the new number of likes.
Why?
I recently played Death Stranding and was really inspired by the social mechanism where youβre encouraged to like everything from a car to a toadstool someone left on top of a mountain. You can also like things rapidily, though it does eventually limit you.
Iβm very passionate about the indie web. Giant mega corporations want us to pretend that magic internet points mean something. As static site pirates we often lose out on the magic internet points and sometimes I miss them! I built this so I can have all of the points.
No, how?
When the image is requested, the worker increments the like count and generates the SVG. I like this approach because it loads immediately and doesnβt need any event listeners. It is completely self contained in a few lines of HTML.
Thereβs an onclick
handler that does a fetch
to https://likes.catskull.net
and then updates the src
with a timestamp to make it refresh.
An onmouseover
and onmouseout
event swap out the like count SVG for a base64 encoded SVG βπ Like!β. Not totally necessary but I think itβs fun!
Additional components could easily be created and I encourage you to make your own!
It's all open source, MIT License.
100% Spyware free. No analytics, no tracking. This page has Cloudflare analytics but the workers do not log or store individual requests. The URL embedding the page is stored in a private Cloudflare D1 database and isn't published anywhere. But isnt the point to let people know you're using it?
Additionally, it is inherintly decentralized by design. All data is public and additional hosts can be implemented with no discernable difference in quality of service or user experience.
π Thanks for stopping by and don't forget to leave a like!
Discuss on Hacker NewsPS - Likes start at 1 because I give everyone their first like π