Created
May 10, 2016 05:49
-
-
Save thesabbir/23e5d85a0fb7d454b0fbeeae9f2343fd to your computer and use it in GitHub Desktop.
Script to find out full github contributions
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
use v5.12; | |
use warnings; | |
use utf8; | |
my $uname = 'thesabbir'; | |
my %projects; | |
for my $year (2014..2016) { | |
for my $month (1..12) { | |
last if $year == 2016 && $month > 1; | |
my $from = sprintf '%4d-%02d-01', $year, $month; | |
my $to = sprintf '%4d-%02d-01', $month == 12 ? ($year + 1, 1) : ($year, $month + 1); | |
my $res = `curl 'https://github.com/$uname?tab=contributions&from=$from&to=$to' | grep 'class="title"'`; | |
while ($res =~ /href="([^"?]+)/g) { | |
my (undef, $user, $repo) = split m{/} => $1; | |
$projects{"$user/$repo"}++; | |
} | |
} | |
} | |
say "$projects{$_}: $_" for sort keys %projects; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment