|determining "number of people on the site"|
any way to code your own small solution?
| 8:02 pm on Feb 20, 2003 (gmt 0)|
everyone has seen sites that list things like "45 people current on the site" and of course with http this has to be subjective because you are simply measuring how many unique IP's requested a page in the last so many minutes
the question is, without turning to a 3rd party stats service, how can I determine this, even if its just for myself and not for public posting (which I think can be tacky in some cases, like public page counters)
is this a complex piece of code? can it be done in perl/SSI? php?
any small open source around that someone can point me to before I waste alot of hours on this ;)
| 8:10 pm on Feb 20, 2003 (gmt 0)|
whos-on.net can do what you what you're looking for, but it is not free ($50-$100). But there is a free demo available, and a live demo on the site.
Maybe someone else knows some free solutions...
| 8:13 pm on Feb 20, 2003 (gmt 0)|
a couple of sites I regularly look at, always have the same amount of visitors 24/7
| 8:26 pm on Feb 20, 2003 (gmt 0)|
Application variables, something like this :
| 8:33 pm on Feb 20, 2003 (gmt 0)|
|is this a complex piece of code? |
Nope. Just type in "82 visitors currently online" somewhere on your page and change the number every hour or so, as to not run into the problem that Shak has noticed.
| 10:04 pm on Feb 20, 2003 (gmt 0)|
what I was thinking is
1. keep a seperate log, a simple text file, written to by the most popular pages on the site via SSI, with a simple timestamp and IP
2. every time the script is triggered (by SSI, etc) first trim the log - remove any entries that are over 5 minutes old
3. every time the script is triggered, after trimmed, count the number of unique ip's found
that final number, more or less, is your number of unique visitors in the past five minutes, hence your "number of people online"
the biggest weakness is of course people on aol proxies and other huge proxies but that number shouldn't too far off
| 8:45 pm on Feb 25, 2003 (gmt 0)|
It sounds like you already know what to do, if you want to see examples of how others have done it...or, you just don't want to re-invent the wheel, you can find scripts that do what you're asking at hotscripts.com. I cannot recommend any particular one, as I haven't used one.
This a good resource for free or open source code for many things, in the language of your choice. I often find it helpful to study someone else's code, when I'm stumped.
I 'highly' recommend that you actually understand every line of code in any of these scripts before deploying it on your site!