Err.... counter!

作者:   發佈於:  

Somehow I am still asked to place a website counter for $websites in the year of 2010. I recalled there was an awesome javascript-based counter service errcount but that website is gone. So I decided to write a tiny one.

I put the source code on github//gugod/errcount, a tiny PSGI app, but still uses DBI and requires a mysql server. It is not documented at all since it should be simple enough for anyone who can read some code. I mean... it's a counter, it adds one to somewhere and does nothing else. It really is that simple.

If you want to try it, add the following lines to your HTML, somewhere inside your <body> tag:

<p style="font-size: 24px;font-weight:bold;">I HAZ
<script  type="text/javascript"
src="http://errcount.gugod.org/"></script>
VIZITRZ.</p>

Here's how it looks like:

I HAZ VIZITRZ.

It uses the http referrer information so one host can have one counter. If there are no referrer information, a random number is yield. If you try to open that URL with your browser and get confused by what you see, yes, that's what it is supposed to be.

If you need it for production, please setup your own errcount server, or donate me to make it better and keep it up and running for you.

I hope that I write this one so I don't have to do it again.

Enjoy.