Thread: Curl or Wget
View Single Post
Old 12-09-2012, 11:25 AM  
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,359
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
;)
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote