Last active
December 25, 2015 13:28
-
-
Save sblask/6983405 to your computer and use it in GitHub Desktop.
Download all available wallpapers from National Geographic's photo contest 2012
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 | |
root=http://ngm.nationalgeographic.com | |
path=ngm/photo-contest/2012/entries/wallpaper | |
type=(nature places people) | |
for kind in "${type[@]}" | |
do | |
for week in {1..13} | |
do | |
index=1 | |
curl $root/$path/$kind-week-$week | | |
awk 'BEGIN {FS="\""} {if ($2=="wallpaper_monitor") print $6}' | | |
while read line | |
do | |
curl -o $kind-`printf %02d $week`-`printf %02d $index`.jpg $root$line | |
let index=index+1 | |
done | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment