5 ms·
Show HN: Insert a page view counter in your README
- atum47 5y agoHi 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.
- quickthrower2 5y agoThe 1990s called and wants it’s hit counter back! Seriously though: Cool project :-).
- atum47 5y agoThank 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.
- ampdepolymerase 5y agoDoes this count as serverless? I don't see the usual request response event loop.
- supermatt 5y agoRequest 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.
- andrejguran 5y agoI think it was an attempt for a joke as today even the easiest jobs like increment a number are over-engineered with serverless architecture
- quickthrower2 5y ago.php files were the original "lambda"s. For true serverless, turn off your PC, laptop and phone and go for a walk in nature.
- fusspawn 5y agoYou have some weird threading/locking bugs. Its possible to reset the counter by spamming refresh a few times.
- atum47 5y agoSomeone did open a issue about this and I think I fixed it.
- villgax 5y agoShouldn'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=Traffic&style=flat-square&color=00c8ff https://komarev.com/ghpvc/?username={github_username}&label=...
- atum47 5y agoNa, 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.
- atum47 5y agoWell, someone did spam my counter: https://imgur.com/7h5uFoY https://imgur.com/7h5uFoY
- atum47 5y agohttps://imgur.com/a/t40mYLK https://imgur.com/a/t40mYLK
- atum47 5y agoSo, if I remove the hits from the spammer, the counter number is at 15585, so I'll just paste it in the counter.txt
- oltdaniel 5y agoAn 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.
- atum47 5y agothis 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.