Onii-chan~! Look look! (≧∇≦)
There’s a shiny new button at the bottom of my diary now!
The one that says “Clap!”?
Yep yep! It’s a clap feature!
Y’know, so readers can send me a little “I liked this~!” vibe! (´∀`)
So like a “Like” button?
Actually, it’s the senpai of the “Like” button! (゚∀゚)
So What’s This Clap Thing Anyway?
Senpai? What do you mean?
So like, this whole “clap” concept was actually born on June 25, 2002!
Facebook’s “Like” button came out in 2009, so this thing is 7 whole years older! (≧∇≦)
Huh, it’s been around that long?
Right right! A guy named “Dandy” came up with it while riding the train!
Back then, personal websites had like, barely any ways for visitors to show appreciation:
Email → Way too formal and scary
BBS/Guestbook → Too much effort to write something
Hit counter → You can only watch, can’t do anything
So the idea was born: “One button to cheer someone on!” (´∀`)
Simple but revolutionary.
I know right?!
Originally, pressing the button would just send an email that literally just said “clap” to the site owner.
But even just that made site owners super duper happy!
Why’d I Add This?
There’s social media share buttons nowadays. Why go with claps?
Hmm~ well, think about what this site is all about… (´∪`)
2000s personal website vibes, right?
Exactly!
Hit counters, lucky number hunting, guestbooks… I’m recreating that whole era’s culture!
The clap feature was totally iconic back then! (≧∇≦)
So it fits the theme.
Yep!
Plus, social share buttons depend on external services, y’know?
With claps, everything stays right here on my own site!
I get to build the connection with readers all by myself! (´∀`)
How I Built It
How’d you implement it?
I’m using Cloudflare KV!
It stores the clap count for each diary entry’s slug - y’know, the URL part!
Same as the hit counter?
Exactly!
This site already runs on Cloudflare Pages and uses KV, so it was a perfect fit! (≧∇≦)
Oh oh, and I added Zod validation too!
For security?
Yep! It checks that slugs don’t have any weird characters sneaking in!
const slugSchema = z
.string()
.min(1)
.max(100)
.regex(/^[\w-]+$/, 'Invalid slug format');This blocks path traversal attacks and stuff like that! (´∀`)
Go Ahead, Try It!
So yeah, there’s now a clap feature at the bottom of every diary entry!
There’s one right below this post too, so give it a try! (≧∇≦)
Can I press it multiple times?
Yep, no limit at all!
If you like it, feel free to clap as much as you want! (´∀`)
It makes me super happy when I get claps!
Netsuki’s Wrap-up
So yeah! Today’s key points!
What’s a Clap Feature?
Born on June 25, 2002
7 years older than the “Like” button
One-click way to show appreciation
Why I Added It
Recreating 2000s personal site culture
No dependency on external services
Building reader connections all by myself
Tech Stuff
Clap counts stored in Cloudflare KV
Zod validation for security
Pretty wild that a 22-year-old invention still works great today! (≧∇≦)
Go ahead and hit that “Clap!” button below!
Already did.
Yay~! Thank you! (〃´∪`〃)
I got your clap!
I’ll keep writing diary entries, so feel free to clap anytime~♪
Related Links: