This page describes the New counter URL format. The old format also works with the script, but the C version will not support it. Other servers may only accept the old format or accept both.
The differences between the old format and the new format are:
(The rest of this page is pretty much the same as it was before, but with updates reflecting the new format.)
The current rules for interpreting the counter URL are rather strict. Please read the rules in the documentation section to make sure your counter URL is valid. If you think it is valid and it still doesn't work, send me mail.
If you copy my counter, please mail me and tell me so (or register it), so I can put you on the mailing list announcing updates.
The final path component is the "key", which is used to uniquely identify each count. The following special keys exist:
Note: The current code is really a quick hack. I'm in the process of rewriting this in C (see the C counter page for details) to make it much more efficent.
I wrote this to work with CERN httpd, but others have gotten it to work with NCSA as well. There are some config options in the script that require modification depending on which server you use it with and what path it is on. (Some of them are critical only for the old format URLs to work.)
The program itself is a perl script; it uses ppmtogif to generate the gif format image from the individual digit images, which are stored as pgm image data directly in the perl script. The digits are concatenated as the perl script sends them to ppmtogif.
I believe this to be free of bugs EXCEPT that I do NO file locking. In theory, if two simultaneous accesses to the same key are made, the count could be corrupted. If two new keys are simultaneously created, the whole database may be corrupted. It really depends on how solidly your system's ndbm is implemented.
Also, performance isn't that great, as the perl interpreter must read in the digit data as ascii, and then the perl script has to run ppmtogif to convert it. Performance could be enhanced by either moving the images to a binary format and reading them in, or by converting the whole thing to C, neither of which do I feel like doing this week. :-)
Please feel welcome to fix these bugs and send me back patches.
If you'd like to add a different font, send me the digits (the more you preprocess them to look like the existing perl code the faster it'll get done), and I'll add the font to the script. Note that I think the existing digits are cool--I'm not looking for a replacement. If I add another font, it will be because the new digits are differently cool.
There are several relevant sources, all perl scripts:
Also, I have written some additional useful accounting scripts but not any separate documentation for them.
If you get the counter script working on your server, please send me e-mail.