Last active
August 29, 2015 14:07
-
-
Save jeffbcross/ab49090d175dc25ad47d to your computer and use it in GitHub Desktop.
Get list of gravatar images for github contributors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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