Skip to content

Instantly share code, notes, and snippets.

@feix
Last active August 6, 2018 13:24
Show Gist options
  • Save feix/1479fe734bc2e6433e03ebbefd440c08 to your computer and use it in GitHub Desktop.
Save feix/1479fe734bc2e6433e03ebbefd440c08 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "download beginning"
years=$(curl -s http://dinosaurpictures.org/ancient-earth | grep option | awk -F'"' '$0 ~ /million|>0</ {print $2}')
base_url=http://dinosaurpictures.org/ancient-earth-assets/images/scotese/
target_path=earth_pics
mkdir -p "$target_path"
IFS=$'\n'
for year in ${years}; do
filename=${year}.jpg
test -f "${target_path}/${filename}" || wget -q "${base_url}${filename}" -O "${target_path}/${filename}"
convert -resize 40% -pointsize 20 -fill white -draw "text 320,400 \"${year} million years ago\"" "${target_path}/${filename}" "${target_path}/00${filename}"
echo "${filename} render done"
done
cd "$target_path" || exit -1
convert -delay 120 -loop 0 $(ls 00*.jpg | sort -t. -k1 -n -r) ancient-earth.gif
echo "ancient-earth.gif render done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment