Last active
December 6, 2019 09:36
-
-
Save st-f/22fe7f3cca8f21641c85 to your computer and use it in GitHub Desktop.
Download X random images from lorempixel.com
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
# usage : sh download.sh 100 | |
# will download 100 pics | |
START=1 | |
for i in $(eval echo "{$START..$1}") | |
do | |
curl "http://lorempixel.com/index.php?generator=1&x=640&y=480&cat=" -o temp.html && cat temp.html | sed -n 's/.*<img src="\([^" ]*\)".*/\1/p' | awk '{print "http://lorempixel.com/"$1}' | xargs curl -o $i.jpg | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if some one wants to have some random word appended to the filename instead of numbers just use the following one on Linux
random_word=
shuf -n1 /usr/share/dict/words
and replace $i with $random_word$i