1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

What does this do?

Discussion in 'JavaScript' started by mcfox, Oct 21, 2010.

  1. #1
    From this thread. I'm thinking some scam-type thing going on but as javascript isn't something I'm good at, I dunno.

    Apparently you log into your adsense account then copy that into your browser window.

    Oh wait, looking at it, it's one of those stupid page rewriters isn't it? So it looks as if your adsense earnings are going up?

    javascript: /*copyright (c) www.wmtips.com 2010*/ function earnMoney() { var t = document.getElementById('content'); var l = t.getElementsByTagName('span'); var s=l[0].innerHTML; re = /[\d\.]+/i; s=s.match(re); c = parseFloat(s); var earn = 0; k = Math.floor(Math.random()*11); if (k > 8) earn += Math.floor(Math.random()*3); if (k > 6) earn += Math.floor(Math.random()*1); if (k > 4) earn += Math.random()*0.5; earn += Math.random()*0.2; c = c + earn; c = Math.round(c*100)/100; l[0].innerHTML = '$'+c+' '; sec = Math.floor(Math.random()*3)+1; setTimeout("earnMoney()",sec*1000); } setTimeout("earnMoney()",2000); void(0);
    Code (markup):

     
    mcfox, Oct 21, 2010 IP
  2. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #2
    As timeclicks pointed out in the other thread, it's an April Fools gag :p
    You are right, it's just a silly rewriter. Check it out!
    
    <html>
    <head>
    <title>April Fools</title>
    <script type="text/javascript">
    function earnMoney() {
        var t = document.getElementById('content');
        var l = t.getElementsByTagName('span');
        var s = l[0].innerHTML;
        re = /[\d\.]+/i;
        s = s.match(re);
        c = parseFloat(s);
        var earn = 0;
        k = Math.floor(Math.random() * 11);
        if (k > 8) earn += Math.floor(Math.random() * 3);
        if (k > 6) earn += Math.floor(Math.random() * 1);
        if (k > 4) earn += Math.random() * 0.5;
        earn += Math.random() * 0.2;
        c = c + earn;
        c = Math.round(c * 100) / 100;
        l[0].innerHTML = '$' + c + '&nbsp;';
        sec = Math.floor(Math.random() * 3) + 1;
        setTimeout("earnMoney()", sec * 1000);
    }
    </script>
    </head>
    <body onload="earnMoney()">
    <div id="content">
    Adsense Earnings: <span>$0</span>
    </div>
    </body>
    </html>
    
    Code (markup):
     
    Cash Nebula, Oct 24, 2010 IP
    mcfox likes this.