浏览代码

Wrote method for filtering stargazer counts

David Leonard 10 年之前
父节点
当前提交
da90fe0353
共有 2 个文件被更改,包括 9 次插入2 次删除
  1. 8 1
      hackathon_starter/hackathon/scripts/github.py
  2. 1 1
      hackathon_starter/hackathon/views.py

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

@@ -121,8 +121,15 @@ def getStarGazerCount():
 			stargazers.append(starData)
 			stargazers.append(starData)
 
 
 	return stargazers
 	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.contrib.auth import authenticate, login
 from django.http import HttpResponse, HttpResponseRedirect
 from django.http import HttpResponse, HttpResponseRedirect
 from scripts.steam import gamesPulling, steamIDPulling 
 from scripts.steam import gamesPulling, steamIDPulling 
-from scripts.github import getUserData, getUserRepositories, getTopContributedRepositories, filterCommits, getStarGazerCount
+from scripts.github import *
 
 
 
 
 def index(request):
 def index(request):