News for hackers. Stuff that matters.
Re:Show HN: Insert a page view counter in your README by villgax on Monday June 28, 2021 @12:14PM (#27663761)
Shouldn't it have an IP/local cookie based filter after one time?

An alternative with the same flaw, https://komarev.com/ghpvc/?username={github_username}&label=...

Re:Show HN: Insert a page view counter in your README by atum47 on Monday June 28, 2021 @01:57PM (#27665191)
Na, I made this one to be simple. That's why I ditched database and everything else. The thread issue I think you can cross data with the server logs to see how many requests were made vs the number on the counter.
Re:Show HN: Insert a page view counter in your README by atum47 on Sunday June 27, 2021 @07:38PM (#27656505)
Hi everyone, I was curious to see how many times my GitHub profile page was visited so I made a counter for it. Since I made it, I've decided to share. Thanks.
Re:Show HN: Insert a page view counter in your README by quickthrower2 on Monday June 28, 2021 @07:45AM (#27660584)
The 1990s called and wants it’s hit counter back! Seriously though: Cool project :-).
Re:Show HN: Insert a page view counter in your README by atum47 on Monday June 28, 2021 @08:17AM (#27660872)
Thank you. I remember this being super popular in my blogging times (this and third party comments system) but when I needed one I didn't find any. So before bed yesterday I wrote one. Glad you liked it.
Re:Show HN: Insert a page view counter in your README by ampdepolymerase on Monday June 28, 2021 @09:48AM (#27661922)
Does this count as serverless? I don't see the usual request response event loop.
Re:Show HN: Insert a page view counter in your README by quickthrower2 on Monday June 28, 2021 @06:37PM (#27669195)
.php files were the original "lambda"s.

For true serverless, turn off your PC, laptop and phone and go for a walk in nature.

Re:Show HN: Insert a page view counter in your README by supermatt on Monday June 28, 2021 @10:01AM (#27662071)
Request response event loop?

It is a dynamic image generator written in PHP that increments the counter it renders. It runs on a PHP web server. Its not serverless.

Re:Show HN: Insert a page view counter in your README by andrejguran on Monday June 28, 2021 @10:15AM (#27662262)
I think it was an attempt for a joke as today even the easiest jobs like increment a number are over-engineered with serverless architecture
Re:Show HN: Insert a page view counter in your README by atum47 on Monday June 28, 2021 @03:11PM (#27666348)
Well, someone did spam my counter:

https://imgur.com/7h5uFoY

Re:Show HN: Insert a page view counter in your README by atum47 on Monday June 28, 2021 @03:26PM (#27666588)
Re:Show HN: Insert a page view counter in your README by atum47 on Monday June 28, 2021 @03:31PM (#27666684)
So, if I remove the hits from the spammer, the counter number is at 15585, so I'll just paste it in the counter.txt
Re:Show HN: Insert a page view counter in your README by oltdaniel on Monday June 28, 2021 @07:57PM (#27669880)
An counter not counting unique visitors or has an rate-limit is the easiest target for anyone knowing how to run an `wrk` command.

There is a reason, why such things aren't this simple.

Re:Show HN: Insert a page view counter in your README by atum47 on Monday June 28, 2021 @09:06PM (#27670441)
this is not a visitor tracker, just a hit counter (page view). I did start writing a parser for the server logs to have a more robust statistics for my website, but there are plenty of good options out there, awstats for instance. this is not it.

the person spamming the counter war trying to corrupt the counter.txt file and reset the counter.

Re:Show HN: Insert a page view counter in your README by fusspawn on Monday June 28, 2021 @11:09AM (#27662936)
You have some weird threading/locking bugs. Its possible to reset the counter by spamming refresh a few times.
Re:Show HN: Insert a page view counter in your README by atum47 on Monday June 28, 2021 @12:03PM (#27663616)
Someone did open a issue about this and I think I fixed it.