Rolling my own bubbles.town widget 13 ▲ Michael Harley 45 days ago · Tech · hide · 1 comments Andreas blogged about adding the bubbles.town widget to his blog. He used the vote widget provided by bubbles.town, which is just a bit of JavaScript you put on your pages. It's well documented and dead simple, so if you just want this on your site with no fuss, that's the way to go. I use 11ty as my blogging platform and I could just use the same JavaScript snippet on my site but I wanted to make something that's a bit more in the spirit of a static site. It's a tiny script, so yeah, I'm being a bit of a purist about it. But I like keeping my pages free of other people's JavaScript and the third-party requests that come along with it. Plus, I wanted to style the widget a bit differently than their widget does. Here is how I did that. What the widget actually does # First I poked at what the widget actually does. I'm no JavaScript wizard, but it didn't take much. When the page loads, the script calls a small API on bubbles.town, GET /api/vote-count?url=..., gets back the vote count… Log in to reply on the Fediverse. Comments will appear here. Kelson @kelson@notes.kvibber.com 45 days ago [-] @michaelharley Cool! I'm planning to do something similar with my 11ty pages too, and for the same reason. Except I don't have it automatically rebuilding, so I may not bother with pulling the current vote count.Though come to think of it, if I'm not going to pull from the API, and just link to the bubbles entry, I can just link to /find?url= and skip the API calls.