Skip navigation.

Harold's Home

   Home
  
XML version of this site

PHP Scripts

Index
CLI fun
Mail on 404
HB-NS (NewsScript)

Downloads

Applescripts
APOD to Desktop
Dreamweaver Extensions

Stuff

Writings
Other stuff
Central Grinder

OOOk Default:

VJ stuff
VJ Tools
Bananas
Strippers
Sample Movies

News

Useless software
Ah, the joy of useless software.

Here's a PHP script that will allow you to grab the current amount of iTunes downloads so you can get ready to grab the 100 millionth song.

<?php
$filename = 'http://phobos.apple.com/external_counter.js';
$fp = fopen("$filename",r);
$contents = fread($fp, 1024);
fclose($fp);
if (preg_match("/([0-9]+)/", "$contents", $match))
{
    echo number_format($match[0]);
}
else
{
    echo "Unknown.";
}
?>


Test it here: http://oook.xs4all.nl/getiTunesDownloads.php.
For extra goodness run the following applescript:
set theCount to (do shell script "curl -s ¬
    http://oook.xs4all.nl/getiTunesDownloads.php")
display dialog "Current iTunes Downloads:" & ¬
    return & return & theCount buttons "OK" ¬
    default button "OK"

Here's how the script looks when run.

Note that Dutch readers won't be allowed to take part, in fact almost no-one, just our American, German, French and British friends as they have their own iTunes stores.
Still, an interesting script, if only because of the use of number_format.

Show all items | Read all items

About, copyright, privacy and accessibility | Mail