Replying to @luna@fedi.mldchan.dev

@luna my old visitor counter broke when it was at ~500 about a year ago due to it being just a text file with a number in it, which was reset to 0 due to some bug that occured when the disk was full; i removed the counter since then and only fixed it 5 days ago, now its recording a timestamp of every visit in postgresql which allows me to visualize popularity of my site over time

see https://pleroma.laru.dsrv.x7q.eu/notice/B7zXTFnTRs3sVaAeUC
pleroma.laru.dsrv.x7q.euLaru (@laru@pleroma.laru.dsrv.x7q.eu)my new visitor counter is so cool

Replying to @luna@fedi.mldchan.dev

@luna oh i didnt wanna record peoples ips, i do deduplication too but by session rather than date, so someone visiting the site twice will only be counted twice if they close their browser between visits, this also ensures that only browsers get counted and curls/crawlers dont

basically it works like this:
1. is visitor cookie set ? proceed : set it to value a
2. send api request to get visitors
3. set cookie to value b

the api request will only count your visit if the cookie is set to value a, which only happens once per session unless you clear your cookies
basically only a client that evaluates javascript will trigger the counter (ofc this can be circumvented by sending the cookie on purpose but why would anyone do that)
Jul 5, 2026, 10:04 UTC