Last active
August 29, 2015 14:04
-
-
Save num3ric/691f5f808cc543dbbc22 to your computer and use it in GitHub Desktop.
Who Shares Code With Artists - http://blairneal.com/blog/who-shares-code-with-artists/
This file contains 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
import requests | |
import json | |
import operator | |
companies = [ "adafruit" , "akqa" , "B-Reel" , "thebarbariangroup" , "cinder" , "BBDO" , "breakfastny" , "CLOUDS-Interactive-Documentary" , "deeplocal" , "digitas" , "morethanlogic" , "dreamworksanimation" , "fakelove" , "field" , "google" , "googlecreativelab" , "dataarts" , "MadSciLabs" , "HeliosInteractive" , "hellicarandlewis" , "ideo" , "ideo-digital-shop" , "labatrockwell" , "legworkstudio" , "local-projects" , "msopentech" , "MidnightCommercial" , "mpcdigital" , "otherlab" , "PixarAnimationStudios" , "Psyop" , "razorfish" , "redpaperheart" , "sapient-global" , "sapientnitro" , "sparkfun" , "stopp" , "tbwa" , "therumpusroom" , "warprecords" , "Vidvox" , "warprecords" , "wieden-kennedy" , "YCAMInterlab" , "Your-Majesty" ] | |
company_stars = {} | |
for company in companies: | |
request_string = 'https://api.github.com/users/' + company + '/repos' | |
r = requests.get( request_string ) | |
company_stars[ company ] = -1 #negative star count indicates invalid request | |
if r.ok: | |
repolist = json.loads(r.text or r.content) | |
start_count = 0 | |
for repo in repolist: | |
start_count += repo['stargazers_count'] | |
company_stars[ company ] = start_count | |
sorted_companies = sorted( company_stars.iteritems(), key=operator.itemgetter(1), reverse=True ) | |
for name_count in sorted_companies: | |
print( name_count[0] + ", " + str( name_count[1] ) ) | |
Yeah definitely interesting, and much more representative of what people are actually finding useful from these places. I also need to find another way to include code from places that share but don't post explicitly to github - or individuals who develop at companies and post to their personal githubs sometimes (I'm guilty of this). Github is unfortunately not always the best place for all of this data collection, but I mostly just wanted to contribute to the conversation in some way.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@laserpilot I actually prefer the table without any numbers (as it is on your blog now), but this is interesting nonetheless. We're closer to a "this is valuable & useful code" metric.