View Full Version : track online visitors

03-15-2012, 04:26 PM

I am trying to create a small art project where I want to track real-time visitors on my site. I am not very good at coding at all and am really struggling to know how to go about this :o
To give you an idea of what I want to achieve; a basic example would be for every live visitor on my site, a circle would appear on the index page. I am aiming for the end product to be a very basic visualisation of live visitors on the site. So just a group of circles representing how many people are on the site.

I am really struggling to get to grips with the coding needed and would hugely appreciate your help.

Thank you very much for your time,

03-15-2012, 04:40 PM
This is only partially a Javascript task ... you need to have a server side component to keep central track of the actions on the page.

Solution example:
1. Set up a setInterval in Javascript that regularly requests a status update from the server (maybe every five seconds)
2. The status update script will collect all the requests and find out (from the IP) how many users are there. The number of users will be reported back to the calling script ... just as a number
3. The server script will also check if there has been an update for each of the registered IPs in the last (let's say) 8 seconds. If not, remove this IP
4. The request callback in Javascript will take this number and create circles ... The easiest way would be to have a circle image and add another image for each loop counting up to the number of users

03-20-2012, 01:28 PM
Thanks for your help! really appreciate it!