#!/bin/sh
# By 6e sixwings@gmail.com
wget http://list.mp3.baidu.com/topso/mp3topsong.html
cat mp3topsong.html | tr \" \\n | pcregrep tsomp3.htm$ > list.raw
CC=1
for VAL in `cat list.raw`
do
wget http://list.mp3.baidu.com/topso/$VAL -O $CC.html &
usleep 100
CC=`expr $CC + 1`
done
NUM=`cat list.raw | wc -l`
CC=1
while [ $CC -le $NUM ]
do
URL=`cat $CC.html | tr \" \\\n | pcregrep mp3$ | pcregrep ^http:// | head -1`
TITLE=`head -8 $CC.html | pcregrep '^<title>'| perl -pe 's/<title>(.*)<\/title>/$1/g' | tr -d ' ' `
echo $URL
echo $URL >> list.mp3
wget "$URL" -O $TITLE.mp3 &
sleep 10
CC=`expr $CC + 1`
done