Who Has The Longest Streak On GitHub?

November 24, 2013

Yesterday I set out on a quest to figure out who actually has the longest streak on GitHub. I did some Duck searches, and found Ryan Seys with a streak of 177, but also found that GitHub doesn’t have a page on their website that ranks uers by their longest streak. So, there really is no way to tell if Ryan really has the longest streak or not.

It looks like there used to be a website that tracked the longest streaks, but not any more, so it looks like I have a great opportunity to make my own app.

My first thought that I had on how I should make the Longest Streak app was to parse each profile page of every single user and get their Longest Streak that is displayed on the page. Which quickly led me to the much smarter way of doing things, the GitHub API. I then played around with curl for awhile to see what all I could do. That then led me to Octokit so that I can use Ruby to make calls to their API. Now we are getting somewhere.

So, this morning I was able to start working on my app to figure out who has the longest streak. My first task was to figure out how I could get a list of all the users. You can only grab ~100 users at a time and there are only 4 million+ users, so it will take awhile to get them all, and store them in my database. But once I do I shouldn’t have to do a query everyday of all the users, I can just query for new users.

Once I get a list of all the users, I’m still going to have to figure out how to calculate the longest streak for each user. Which I htink I can do with contributions_calendar_data, but not sure if I can get the previous year yet or not.

I’m off to a humble start, but you are more than welcome to join me in my quest in figuring out who has the longest streak on GitHub.