紅極一時的無名小站即將走入尾聲了(感覺也是早晚的事,被Yahoo收購後,並沒什麼大動作,維持原樣好幾年了),以前也跟著流行,註冊個免費帳號,丟了些照片上去。雖然早就已經搬家到Flickr.com一段時間了,但無奈之前硬碟掛掉,還是有些舊照片在上頭,打包一份留念吧。由於無名教學並沒有CLI版本的,身為CLI魔人,實在是懶得一個個下載,花個5分鐘弄個小程式,自行建目錄、下載打包。最後,悼念一下那些年我們一起上的無名。
This file contains 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 | |
# Modify below 2 variables if needed | |
ALBUM_NUM=50 | |
ALBUM_FOLDER="./SambaGhost-data/album/" | |
cd ${ALBUM_FOLDER} | |
for (( i = 1; i <= ${ALBUM_NUM}; i++ )); do | |
echo "==> Create folder ${i}" | |
mkdir ${i} | |
cd ${i} | |
echo "==> Download album ${i}.txt" | |
wget -q -i ../${i}.txt | |
echo "==> Batch file rename" | |
for pic in `ls`; do | |
mv $pic $(echo $pic | cut -d '?' -f 1) | |
done | |
cd - | |
done | |
echo "==> Done" |