How do I get a list of all the GitHub projects that I contributed last year?

I understand that I can click https://api.github.com/users/:user_id/repos to get a list of all the repositories that I own or have branched. But what I would like to do is find out all the projects that I submitted (earned, pulled out requests, problems, etc.) over the past year. The event API allows me to retrieve the last 300 events, but over the past twelve months I have contributed a lot to this. Is it possible?

+25
github api events
Jan 24 '14 at 1:31
source share
2 answers

Thanks to a tweet from @caged , I wrote this Perl script to iterate over the months in my contributions :

 use v5.12; use warnings; use utf8; my $uname = 'theory'; my %projects; for my $year (2012..2014) { for my $month (1..12) { last if $year == 2014 && $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; 

Yes, an HTML scraper is ugly, but it did the trick for my needs.

+4
Feb 06 '14 at
source share

I came across this question a while ago, and it annoyed me that I could not find the answer (I wanted to list all my projects in my resume).

GitHubContributions.io

Anyone can use the JSON REST API methods (only /user/<username> and /user/<username>/events/<page> ), although the site is ridiculously slow because I have 250 million entries from VPS with 1 GB of RAM . If you want the source data to be compiled (lots of GB JSON), I would be happy to provide it to you.

GitHub code (of course): github.com/hut8/github-contributions

+25
Sep 08 '15 at 18:52
source share



All Articles