Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

clayj

macrumors 604
Original poster
Jan 14, 2005
7,648
1,384
visiting from downstream
Just happened to be looking at the Apple web site when this number came around, and my luck was good enough for me to capture this... no Photoshopping at all, I promise you (except to crop the image).
 

Attachments

  • 484484484.jpg
    484484484.jpg
    134 KB · Views: 290

besler3035

macrumors 6502a
Oct 29, 2004
561
110
Grand Rapids, MI
clayj said:
Just happened to be looking at the Apple web site when this number came around, and my luck was good enough for me to capture this... no Photoshopping at all, I promise you (except to crop the image).

The font for the numbers 484,484,484 looks thicker than on Apple's website. Something tells me that you're not being too honest here...
 

wordmunger

macrumors 603
Sep 3, 2003
5,124
3
North Carolina
Umm... I imagine whatever font that displays there is going to depend on what fonts ClayJ has installed on his system. If he has the font, then he can use it to photoshop the image, so why would he use a different font? Basically, we're just going to have to take ClayJ's word for it, unless someone can give more convincing evidence that it was photoshopped.

edit: I should add that if I were going to photoshop this, I would just use whatever the first three digits were in the original screenshot. No need to mess with fonts whatsoever -- just a quick copy and paste.
 

emw

macrumors G4
Aug 2, 2004
11,172
0
What's more amazing is the rate - about 15-20 per second. Don't know if it's people trying to win, or if that's just the normal rate of purchase.
 

clayj

macrumors 604
Original poster
Jan 14, 2005
7,648
1,384
visiting from downstream
emw said:
What's more amazing is the rate - about 15-20 per second. Don't know if it's people trying to win, or if that's just the normal rate of purchase.
It's gotta be the normal rate of purchase, because we're obviously not near 500M yet, and the 100K prize intervals are still pretty spread out. I don't buy bits, but in the grand tradition of Charlie Bucket, I will try to buy the 500Mth song.

And to those who doubt my veracity regarding the non-altered state of my picture, I have just one thing to say to you:

PHBPFFPPTBHT!
 

wordmunger

macrumors 603
Sep 3, 2003
5,124
3
North Carolina
emw said:
What's more amazing is the rate - about 15-20 per second. Don't know if it's people trying to win, or if that's just the normal rate of purchase.

Someone (presumably with more coding expertise than me) said that it's not connected to a database, just a simple counter. I wonder if they "recalibrate" from time to time to match actual sales. Though 15-20 per second doesn't strike me as altogether unreasonable. You have to count pretty fast to get to 500 million.
 

Attachments

  • rates.gif
    rates.gif
    5.6 KB · Views: 229

angelneo

macrumors 68000
Jun 13, 2004
1,541
0
afk
wordmunger said:
Someone (presumably with more coding expertise than me) said that it's not connected to a database, just a simple counter. I wonder if they "recalibrate" from time to time to match actual sales. Though 15-20 per second doesn't strike me as altogether unreasonable. You have to count pretty fast to get to 500 million.
I would think it is pretty illogical to connect it to the database since the number of people who visit their main page is pretty huge, and the polling probably will kill the connection pool. Most likely the programmers did a quick rate count and then hard code it to the site.
 

tobefirst ⚽️

macrumors 601
Jan 24, 2005
4,612
2,335
St. Louis, MO
clayj said:
PHBPFFPPTBHT!

So THAT's how you spell that! :) I'd always wondered.

Nice catch, Clayj!

If someone is willing to photoshop this, they've got way too much time on their hands...speaking of which, why were you screen capturing Apple's site in the first place? (; Just kidding....
 

clayj

macrumors 604
Original poster
Jan 14, 2005
7,648
1,384
visiting from downstream
tobefirst said:
So THAT's how you spell that! :) I'd always wondered.

Nice catch, Clayj!

If someone is willing to photoshop this, they've got way too much time on their hands...speaking of which, why were you screen capturing Apple's site in the first place? (; Just kidding....
I went to the page and saw that the ticker was at something like 484,483,900 or so, and being the pattern recognition filter that I am, I decided to try to capture it right at 484,484,484. Luckily my timing was good and I caught the right thing... if I'd caught 484,484,485, you would not have seen a post from me. :)
 

Doctor Q

Administrator
Staff member
Sep 19, 2002
40,095
8,366
Los Angeles
This could be a new game! Try to take a screenshot as the counter passes a multiple of 1,000, 10,000, or higher. I've missed three times so far, but it's better than I did at that throw-the-paper-in-the-wastebasket game. :)
 

cwedl

macrumors 65816
Jun 5, 2003
1,407
32
yellow said:
Nice catch.. I really wonder how accurate that ticker is..


Nor very at all, I refreshed the itunes website and the number went back, and then I refreshed again and it went forward but not as much as it did the first time.
 

ham_man

macrumors 68020
Jan 21, 2005
2,265
0
PHP:
	<td>
			<div id="counterbillboard">
				<div id="counter">
					<h2 id="countdown"></h2>
				</div>
				<form id="form-thismustbehere"><div><input id="thismustbehere"> <!-- dunstan: this HAS to be here or the countdown flickers in FF --></div></form>
				<a href="/itunes/500million/" class="blocklink"><img src="http://images.apple.com/home/2005/images/promoitmscounttrans20050705.gif" width="334" height="120" border="0" alt="iTunes Music Store 500 Million Song Countdown. Download songs. Win Prizes."></a>
			</div>
		</td>
That is the HTML code on Apple's site for the counter, if it matters to anybody.

Oh, and cool catch there Clayj. Must have been pretty lucky, cause the ticker goes FAST...
 

tech4all

macrumors 68040
Jun 13, 2004
3,399
489
NorCal
Does this ticker actually go up as music is bought from the iTMS? Or does it just go up on it's own?
 

emw

macrumors G4
Aug 2, 2004
11,172
0
Doctor Q said:
This could be a new game! Try to take a screenshot as the counter passes a multiple of 1,000, 10,000, or higher. I've missed three times so far, but it's better than I did at that throw-the-paper-in-the-wastebasket game. :)
Took me three tries... Just what I needed, another time-waster.
 

Attachments

  • Picture 1.jpg
    Picture 1.jpg
    5.4 KB · Views: 124

michaelrjohnson

macrumors 68020
Aug 9, 2000
2,180
5
53132
I really wanted to play Doctor Q's new game... but my office's myriad of filters block anything from the iTunes domain. Including the simple JS that is the counter.

See? :(
 

Attachments

  • iTMS_Blank.JPG
    iTMS_Blank.JPG
    7.8 KB · Views: 146

wdlove

macrumors P6
Oct 20, 2002
16,568
0
Doctor Q said:
This could be a new game! Try to take a screenshot as the counter passes a multiple of 1,000, 10,000, or higher. I've missed three times so far, but it's better than I did at that throw-the-paper-in-the-wastebasket game. :)

I have great confidence in your abilities Doctor Q. ;) Will look forward to your first entry. :D
 

SpaceMagic

macrumors 68000
Oct 26, 2003
1,744
9
Cardiff, Wales
wordmunger said:
Someone (presumably with more coding expertise than me) said that it's not connected to a database, just a simple counter. I wonder if they "recalibrate" from time to time to match actual sales. Though 15-20 per second doesn't strike me as altogether unreasonable. You have to count pretty fast to get to 500 million.

I found it's connected to an XML feed, presumably from the database.

Apple Home page... view source.. you get:

Code:
<script src="http://wdirect.apple.com/home/counter500million.js" type="text/javascript" language="javascript"></script>


follow that link.. and you get:

Code:
function addEventToObject(obj, evt, func) {
	var oldhandler = obj[evt];
	obj[evt] = (typeof obj[evt] != 'function') ? func : function(){oldhandler();func();};
}

function intComma(num) {
    var T = "", S = String(num), L = S.length - 1, C, j, P = S.indexOf(".") - 1;
    if (P < 0) {P = L;}
    for (j = 0; j <= L; j++) {
        T += (C = S.charAt(j));
        if ((j < P) && ((P - j) % 3 == 0) && (C != "-")) {T += ",";}
    }
    return T;
}

function ajaxRequest(url,func) {
    if (window.XMLHttpRequest) {
        var req = new XMLHttpRequest();
        if (func) {req.onreadystatechange = function() {func(req);}}
        req.open("GET", url, true);
        if (browser.isSafari) {req.setRequestHeader('If-Modified-Since','Wed, 15 Nov 1995 00:00:00 GMT');}
        req.send(null);
    } else if (window.ActiveXObject) {
        isIE = true;
		try {var req = new ActiveXObject("Msxml2.XMLHTTP");}
		catch(e) {req = new ActiveXObject("Microsoft.XMLHTTP");}
        if (req) {
            if (func) {req.onreadystatechange = function() {func(req);}}
            req.open("GET", url, true);
            req.send();
        }
    }
}

//initialize vars
var c, ci, initDate, curDate, curDateElapsed, curCountElapsed, preDate, dateDiff, timeoutID;
var initCount = curCount = preCount = addCount = tempCount = countDiff = rate = 0;
var XMLHttpRequests = 0; // DEBUG
var update = 5 //in mins
var incr = 100 //in msecs
var refresh = 60000 //in msecs, should be 1 min (60000 ms)
var safariBugFixCounter = null;
var countTimer = null; //dunstan

function initializeProcessReqChange(req)
	{
	if (req.readyState == 4) 
		{
		if (req.status == 200)
			{
			setCounters(req);
			if (XMLHttpRequests < 1 || !countTimer) runCountdown(); //dunstan
			XMLHttpRequests+=1;/*DEBUG*/
			} 
		else
			{
			//alert("There was a problem retrieving the XML data:\n" + req.statusText); //dunstan
			clearTimeout(countTimer); //dunstan
			countTimer = null; //dunstan
			}
		}
	document.body.style.cursor = 'default';
	return true;
	}

function setCounters(req) {	
	preCount = parseInt(req.responseXML.getElementsByTagName('count')[1].childNodes[0].nodeValue);
	//if new values
	if (preCount == initCount || initCount == 0) {
		initCount = parseInt(req.responseXML.getElementsByTagName('count')[0].childNodes[0].nodeValue);
		initDate = new Date(req.responseXML.getElementsByTagName('count')[0].getAttribute('timestamp'));
		preDate = new Date(req.responseXML.getElementsByTagName('count')[1].getAttribute('timestamp'));
		//calculate difference in values
		countDiff = initCount-preCount;
		//calculate difference in time of values
		dateDiff = parseInt(initDate.valueOf()-preDate.valueOf());
		//calculate rate of increase ((songs downloaded in previous time)/time)*incr
		rate = countDiff/dateDiff;
		rate = rate*0.8; //dunstan adjusting the rate down to 80% as per dan's instructions
		//calculate number of songs to add each loop
		//calculate current time
		curDate = new Date();
		//calculate time since last update
		curDateElapsed = curDate.valueOf() - initDate.valueOf();
		//calculate projected number of songs since last update
		curCountElapsed = curDateElapsed*rate;
		//add projected number of songs to most recent value
		curCount = initCount+curCountElapsed;
	}
}

function runCountdown() {
		//increase value of counter at constant increment
		//calculate number of songs to increase per increment
		//multiply rate by increment
		addCount = rate*incr;
		//add this number to counter
		curCount += addCount;
		//update document content
		//set counter to predicted count
		c.innerHTML = (curCount<500000000) ? intComma(Math.floor(curCount)) : "500,000,000+";
		if (ci) {ci.innerHTML = (curCount<500000000) ? intComma(Math.floor(curCount)) : "500,000,000+";}
		
		
		
		document.getElementById('thismustbehere').value = curCount;
		
		
		
		countTimer = setTimeout(runCountdown, incr); //dunstan
}

function doCountdown() {	
		//get most recent values from xml and process
		ajaxRequest('http://www.apple.com/itunes/external_counter.xml',initializeProcessReqChange);
		//on one minute loop
		var refreshTimer = setTimeout(doCountdown,refresh);
}
//on page load 
function initCountdown() {
	//create reference to counter object
	c = document.getElementById('countdown');
	ci = (document.getElementById('countdown2')) ? document.getElementById('countdown2') : null;
	//do countdown
	if ((browser.isIE == true) && (browser.isMac == true)) {
		var counterDiv = (document.getElementById('counter')) ? document.getElementById('counter') : null;
		//Put any chunk of HTML in here you wish to be displayed for IE Mac
		var ieMacContent = '<a href="/itunes/500million/"><img src="http://images.apple.com/home/2005/images/itmscounteriemac20050705.gif"></a>';
		counterDiv.innerHTML = ieMacContent;
	} else {
		doCountdown();
	}
}
addEventToObject(window,'onload',initCountdown);


Look in THAT code and you find:

Code:
function doCountdown() {	
		//get most recent values from xml and process
		ajaxRequest('http://www.apple.com/itunes/external_counter.xml',initializeProcessReqChange);

Follow this .xml and you get:

Well.. look...
http://www.apple.com/itunes/external_counter.xml
 

Doctor Q

Administrator
Staff member
Sep 19, 2002
40,095
8,366
Los Angeles
wdlove said:
I have great confidence in your abilities Doctor Q. ;) Will look forward to your first entry. :D
I win! I win! And I have Photoshop to thank!

(Perhaps I should have waited until the counter actually got to 485,000,000 before posting this.)
 

Attachments

  • 485000000.png
    485000000.png
    11.6 KB · Views: 143

michaelrjohnson

macrumors 68020
Aug 9, 2000
2,180
5
53132
Doctor Q said:
I win! I win! And I have Photoshop to thank!

(Perhaps I should have waited until the counter actually got to 485,000,000 before posting this.)
I'm not sure you're allowed to win at your own game, are you Dr. Q? :D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.