09/07/02 22:46:59 sUoFv0PL
眠れない夜に
#! /bin/bash
echo "What terms?"; read terms; terms="${terms// /+}"
T="$HOME"
mkdir -p $T/${terms}
for n in $(seq 0 20 300); do w3m -dump_source \
"URLリンク(images.google.com)"
done | sed -e 's/","http/\n","http/g; s/","/\n","/g' | \
grep -w "\",\"http:.*.jpg" | sed -e 's/^.*http/http/g' | \
while read URL ; do
wget -P $T/${terms} -r -l 1 --timeout=30 --tries=2 -c -e robots=off -U 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)' $URL
done
sleep 3
I="`date +${terms}%Y%m%d`"
( cd $T/${terms}
find . -name "*.jpg" -a -size +30k | while read list; do
eval convert -strip $list $I$(printf %05d $num).jpg
let num=$num+1
done
)