rm cookie tmp curl -c cookie -b cookie http://www.shoutcast.com/ for i in {10,20,30,40,50,60,70,80,90,100} do sleep 1 curl -c cookie -b cookie -d "order=desc&criteria=listenershead&count=10&strIndex=$i&ajax=true" http://www.shoutcast.com/ajax_dir | tr -d '\n' | awk '{gsub("<","\n<"); print}' | grep 'pls' | sed -e 's/.*pls\?id=//g' -e 's/.*pls?id=//g' -e 's/\".*//g' | grep '[0-9]' | awk '!x[$0]++' >> tmp done for i in `cat tmp` do curl -c cookie -b cookie http://yp.shoutcast.com/sbin/tunein-station.pls?id=$i | egrep "(:80$|:80\/)" | sed -e 's/.*=//g' | head -n 1 > /rmccurdy/m3u.m3u sleep 1 done