Skip to content

Instantly share code, notes, and snippets.

@francois2metz
Created October 24, 2011 21:34
Show Gist options
  • Save francois2metz/1310386 to your computer and use it in GitHub Desktop.
Save francois2metz/1310386 to your computer and use it in GitHub Desktop.
Create a screenshot of a website for each commits in a git repository
#!/usr/bin/env sh
# Under WTPL 2
# https://github.com/AdamN/python-webkit2png
COMMITS=$(git log --format="%H" --reverse)
OUTPUT_DIR="/tmp"
i=0
for commit in ${COMMITS}
do
i=$(expr $i + 1)
if [ ! -f "$OUTPUT_DIR/$i.png" ]; then
git checkout $commit
webkit2png.py -F javascript --aspect-ratio crop --scale 1366 1000 -o $OUTPUT_DIR/$i.png http://localhost:9292/index.html -w 1 -x 1366 1000
fi
done
ffmpeg -qscale 5 -r 5 -b 9600 -i $OUTPUT_DIR/%d.png movie.webm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment