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).
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.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.
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.
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.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.
clayj said:PHBPFFPPTBHT!
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.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....
yellow said:Nice catch.. I really wonder how accurate that ticker is..
<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>
Took me three tries... Just what I needed, another time-waster.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.
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.
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.
<script src="http://wdirect.apple.com/home/counter500million.js" type="text/javascript" language="javascript"></script>
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);
function doCountdown() {
//get most recent values from xml and process
ajaxRequest('http://www.apple.com/itunes/external_counter.xml',initializeProcessReqChange);
I win! I win! And I have Photoshop to thank!wdlove said:I have great confidence in your abilities Doctor Q. Will look forward to your first entry.
I'm not sure you're allowed to win at your own game, are you Dr. Q?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.)