Here is an example i did recently with wget
Code:
#!/bin/bash
# grab images from fishki.net blog posts
if [ $# -ne 1 ]
then
echo "fishki.net url to grab images needed."
exit
fi
if [[ "$1" == http://fishki.net/comment.php?id=* ]]
then
echo "downloading..."
dir=`date "+%Y-%m-%d_%H:%M"`;
wget -r -p -q -nd -e robots=off -P images_$dir -A '*.jpg' -R 'tn.jpg' -H -D 'ru.fishki.net' $1
echo -n "images saved: " ; ls images_$dir/ | grep ".jpg" -c
else
echo "invalid url: must contain http://fishki.net/comment.php?id=xxxxx"
fi
exit 64
;;
esac
;)