views:

333

answers:

4

I'm using this bit of code to display the number of users on a site. My customer is complaining it looks fake. Any suggestions?

    var visitors = 187584;
    var updateVisitors = function()
        {
            visitors++;

            var vs = visitors.toString(), 
                 i = Math.floor(vs.length / 3),
                 l = vs.length % 3;
            while (i-->0) if (!(l==0&&i==0))
                vs = vs.slice(0,i*3+l)
                   + ',' 
                   + vs.slice(i*3+l);
            $('#count').text(vs);
            setTimeout(updateVisitors, Math.random()*2000);
        };

    setTimeout(updateVisitors, Math.random()*2000);

Edited:

alt text Screenshot-Advertise - Stack Overflow - Chromium

http://inedomedia.com/stackoverflow.aspx

+7  A: 

I'm guessing it looks fake because every time you load the page it starts at the same number and counts upwards?

Take a look at the javascript that tells you how many megabytes of email storage you get with a Gmail account. I think it bases the starting number on the date/time, so that if you load a page, watch it count up, and then load it again, it won't reload with a smaller number.

Be honest though... it is fake right? You aren't showing precisely how many users there are and updating it live as new users create accounts. The goal then is to make sure it is somewhat close to reality. Hopefully the rate at which the number increases in your script is based on past new-user subscription rates.

Dan
+7  A: 

Warning: Attempted Humour

Did he ask for a giant splash page to go along with the fake real-time visitor counter? How about some nice "Netscape Now!" button logos and blinking text? Here are some really cool "under construction" animated gifs you can use too.

http://www.animatedgif.net/underconstruction/construction.shtml

-Oisin

x0n
Don't mess with the 90s!
Ben
Don't forget the autoplaying MIDI.
Steve
You know, Macromedia has this amazing new thing called Flash. You can do awesome animations and multimedia stuff with it. Maybe a really long intro instead of a splash page? - Ok that's enough, I'm getting sick ...
Techpriester
alex
@Steve, myspace still has those and the midis too :P
Anurag
Hahaha, alex, that is amazing. Wow.
Steve
+10  A: 

Everyone knows JS counters are fake, don't bother trying to make it look "less fake", bother making a real one.

If you don't have enough visitors to show around, just don't use a counter, they're so 90's.

Ben
+1 for that last comment. No-one give a rats backside how many people visit your site. Just make it good, word will spread, people will link to you and Google will bump you up in its rankings. Having a site tell us how popular it is is no different to a slick-oil used car dealer telling us how trustworthy they are.
paxdiablo
A: 

make the interval parameter of the setInterval random as well ... it will look more real as it will randomly increment the random numbers :)

emre