diff --git a/build/gource/README.md b/build/gource/README.md new file mode 100644 index 00000000000..be8f6acabce --- /dev/null +++ b/build/gource/README.md @@ -0,0 +1,4 @@ +# Command to run gource on Dolibarr git project. + +cd ~/git/dolibarr +gource -logo doc/images/appicon_64.png --highlight-users --highlight-colour FFFF88 -s 0.2 -1280x720 -r 25 -title 'Dolibarr ERP CRM Genesis' --stop-at-end --filename-time 2 --user-image-dir build/gource/avatars \ No newline at end of file diff --git a/build/gource/avatars/.gitignore b/build/gource/avatars/.gitignore new file mode 100644 index 00000000000..b44ef384e2d --- /dev/null +++ b/build/gource/avatars/.gitignore @@ -0,0 +1 @@ +/*.png diff --git a/build/gource/getavatars.pl b/build/gource/getavatars.pl new file mode 100755 index 00000000000..1f73da34e91 --- /dev/null +++ b/build/gource/getavatars.pl @@ -0,0 +1,49 @@ +#!/usr/bin/perl +#fetch Gravatars + +use strict; +use warnings; + +use LWP::Simple; +use Digest::MD5 qw(md5_hex); + +my $size = 90; +my $output_dir = './avatars'; + +die("no .git/ directory found in current path\n") unless -d './avatars'; + +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() { + 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; +