Created
July 11, 2012 14:11
-
-
Save loranger/3090593 to your computer and use it in GitHub Desktop.
Gource current git working copy
This file contains hidden or 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
#!/usr/bin/perl | |
#fetch Gravatars | |
use strict; | |
use warnings; | |
use LWP::Simple; | |
use Digest::MD5 qw(md5_hex); | |
my $size = 90; | |
my $output_dir = '.git/avatar'; | |
die("no .git/ directory found in current path\n") unless -d '.git'; | |
mkdir($output_dir) unless -d $output_dir; | |
open(GITLOG, q/git log --pretty=format:"%ae|%an" |/) or die("failed to read git-log: $!\n"); | |
my %processed_authors; | |
while(<GITLOG>) { | |
chomp; | |
my($email, $author) = split(/\|/, $_); | |
next if $processed_authors{$author}++; | |
my $author_image_file = $output_dir . '/' . $author . '.png'; | |
#skip images we have | |
next if -e $author_image_file; | |
#try and fetch image | |
my $grav_url = "http://www.gravatar.com/avatar/".md5_hex(lc $email)."?d=404&size=".$size; | |
warn "fetching image for '$author' $email ($grav_url)...\n"; | |
my $rc = getstore($grav_url, $author_image_file); | |
sleep(1); | |
if($rc != 200) { | |
unlink($author_image_file); | |
next; | |
} | |
} | |
close GITLOG; |
This file contains hidden or 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 | |
./fetchAvatars.pl | |
#gource --title "PhoenixCorp evolution" --user-image-dir .git/avatar/ --camera-mode track --background 555555 --logo .git/avatar/small.png --hide filenames,mouse,progress -1280x720 -o gource.ppm | |
gource --title "PhoenixCorp evolution" --user-image-dir .git/avatar/ --camera-mode overview --background 555555 --logo .git/avatar/small.png --hide filenames,mouse,progress -640x480 -o gource.ppm | |
ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i gource.ppm -vcodec libx264 -preset ultrafast -crf 1 -threads 0 -bf 0 gource.mp4 | |
rm gource.ppm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment