Skip to content

Instantly share code, notes, and snippets.

@jeffbcross
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jeffbcross/ab49090d175dc25ad47d to your computer and use it in GitHub Desktop.
Save jeffbcross/ab49090d175dc25ad47d to your computer and use it in GitHub Desktop.
Get list of gravatar images for github contributors
#!/bin/bash
# Usage ./images.sh optional-start-sha optional-end-sha
# ./images.sh eaa1d00b24008f590b95ad099241b4003688cdda HEAD
if [ $1 ]; then
start="$1.."
else
start=""
fi
if [ $2 ]; then
end="$2"
else
end="HEAD"
fi
emails=(`git log --format='%ae' $start$end | sort -u`)
count=0
while [ "x${emails[count]}" != "x" ]
do
email=${emails[$count]}
email=$email | tr -d ' ' | tr '[:upper:]' '[:lower:]'
output=($(md5 -s "$email"));
output=${output[3]}
echo "<img src=\"http://gravatar.com/avatar/$output\">"
count=$(( $count + 1 ))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment