Skip to content

Instantly share code, notes, and snippets.

@ellisio

ellisio/scrape.sh

Created Jun 4, 2014
Embed
What would you like to do?
Scan for iTunes album art sizes.
#!/bin/bash
rm -rf images
mkdir images
for i in {1..1024}
do
for x in {1..100}
do
echo "Checking ${i}x${i}-${x}"
CODE=`curl -o /dev/null --silent --head --write-out '%{http_code}' http://a4.mzstatic.com/us/r30/Music/v4/d7/b9/de/d7b9de4b-89c0-bd93-fa99-f5508a453af2/KatyPerryiTunes.${i}x${i}-${x}.jpg`
if [ $CODE == "200" ]; then
wget -O images/${i}x${i}-${x}.jpg http://a4.mzstatic.com/us/r30/Music/v4/d7/b9/de/d7b9de4b-89c0-bd93-fa99-f5508a453af2/KatyPerryiTunes.${i}x${i}-${x}.jpg
fi
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.