Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// 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`;
foreach ($log as $line) {
preg_match('/^\s*[0-9]+\s([^\<]+)\s\<([^\>]+)\>$/i', $line, $matches);
$user = array('name' => $matches[1], 'email' => md5($matches[2]));
$url = '"' . $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