Created
December 21, 2010 05:54
-
-
Save yanyaoer/749555 to your computer and use it in GitHub Desktop.
获取xiami.com标为喜欢的艺人
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#虾米电台不给力啊! 哥要导到豆瓣去咯 | |
#SETTING BEGAIN | |
uid='' #要抓的用户id, 比如我的就是11087 | |
maxPage="25" #一共要抓的页数 | |
i="0" #起始页数 | |
TMP="/tmp/xiami" #缓存目录 | |
FILE="./fav.txt" #最后保存文件 | |
#SETTING END | |
while [ $i -lt $maxPage ] | |
do | |
i=$[$i+1] | |
curl -i http://www.xiami.com/space/lib-artist/u/$uid/page/$i | grep class=\"name >> $TMP | |
done | |
sed -e 's/^.*title="播放//g' -e 's/的电台.*$//g' -e 's/\+/\\+/g' -e 's/ /\+/g' $TMP > $FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment