Explorar el Código

Wrote method for filtering stargazer counts

David Leonard hace 10 años
padre
commit
da90fe0353

+ 8 - 1
hackathon_starter/hackathon/scripts/github.py

@@ -121,8 +121,15 @@ def getStarGazerCount():
 			stargazers.append(starData)
 
 	return stargazers
-	
 
+def filterStarGazerCount(data):
+	maxStars= []
+	for i in range(1, 10):
+		maxStarGazers = max(data, key=lambda x:x['stargazers_count'])
+		maxCommits.append(maxStarGazers)
+		index = data.index(maxStarGazers)
+		data.pop(index)
+	return maxStars
 
 
 

+ 1 - 1
hackathon_starter/hackathon/views.py

@@ -5,7 +5,7 @@ from django.template import RequestContext, loader
 from django.contrib.auth import authenticate, login
 from django.http import HttpResponse, HttpResponseRedirect
 from scripts.steam import gamesPulling, steamIDPulling 
-from scripts.github import getUserData, getUserRepositories, getTopContributedRepositories, filterCommits, getStarGazerCount
+from scripts.github import *
 
 
 def index(request):