Skip to content

Instantly share code, notes, and snippets.

@will-in-wi
Created September 7, 2012 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save will-in-wi/3668580 to your computer and use it in GitHub Desktop.
Save will-in-wi/3668580 to your computer and use it in GitHub Desktop.
Test for iTunes Album Art Sizes
<?php
$starting_links = array('http://a5.mzstatic.com/us/r1000/107/Music/v4/3a/1c/4b/3a1c4bff-7b99-2162-3036-54157c6924e6/0818610010094_1200x1200_300dpi.100x100-75.jpg',);
$timeout = 1; // In seconds
foreach ($starting_links as $link) {
$curr_size = 25;
while ($curr_size < 2000) {
$result = get_headers(str_replace('100x100', $curr_size . 'x' . $curr_size, $link));
if ($result[0] === 'HTTP/1.0 404 Not Found') {
//print $curr_size . " didn't work\n";
} else {
print $curr_size . " worked!!!\n";
}
$curr_size += 25;
sleep($timeout);
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment