2 hours ago · Tech · hide · 0 comments

For a long time I thought it’d be nice if there was a simple way for people to interact with my posts. When you write something it’s nice to know that someone took the time to read what you wrote and maybe even got some enjoyment out of it. I’m glad for those who let me know on Bluesky or Fedi <3 Bear Blog has an unintrusive upvote button at the end of each post. But I’m not using Bear Blog – my blog is statically generated and I’d like to keep it that way. So last weekend I got the idea of writing a simple web service that you can give the URL for a post, and it’ll either return the number of upvotes or let you add an additional one. To get started I looked at the source code for Bear Blog to figure out how to prevent repeated upvotes and protect against potential abuse. In the end the only thing I adapted was storing an upvote as the hash of a visitor’s IP address together with the current year, which has one minor issue (if you post something at the end of a year it can be upvoted…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.