Skip to content

Instantly share code, notes, and snippets.

@feix feix/ancient-earth_gif.sh
Last active Aug 6, 2018

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.