Skip to content

Instantly share code, notes, and snippets.

@num3ric
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save num3ric/691f5f808cc543dbbc22 to your computer and use it in GitHub Desktop.
Save num3ric/691f5f808cc543dbbc22 to your computer and use it in GitHub Desktop.
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] ) )
@num3ric
Copy link
Author

num3ric commented Jul 23, 2014

@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.

@laserpilot
Copy link

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