Created
May 8, 2010 00:10
-
-
Save predominant/394169 to your computer and use it in GitHub Desktop.
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
#!/opt/local/bin/php | |
<?php | |
// Get a git log | |
$log = trim(`git shortlog -s -n -e`); | |
$log = explode("\n", $log); | |
// Clean and make a new directory for images. | |
`rm -rf gource-gravatars`; | |
mkdir('gource-gravatars'); | |
chdir('gource-gravatars'); | |
foreach ($log as $line) { | |
preg_match('/^\s*[0-9]+\s([^\<]+)\s\<([^\>]+)\>$/i', $line, $matches); | |
$user = array('name' => $matches[1], 'email' => md5($matches[2])); | |
$url = '"http://www.gravatar.com/avatar/' . $user['email'] . '?s=100"'; | |
$name = '"' . utf8_encode($user['name']) . '.jpg"'; | |
//echo "wget {$url} -O {$name}\n"; | |
echo "."; | |
`wget {$url} -o {$name}`; | |
} | |
echo "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment