Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sblask/6983405 to your computer and use it in GitHub Desktop.
Save sblask/6983405 to your computer and use it in GitHub Desktop.
Download all available wallpapers from National Geographic's photo contest 2012
#!/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