-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathgit_example.py
More file actions
31 lines (22 loc) · 948 Bytes
/
git_example.py
File metadata and controls
31 lines (22 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python
from github2.client import Github
api_token = 'mattalcock'
api_user = '43de91f8870bf58cda7945304baf4faa'
#Currently 2,259,699 repos. I think we can pre populate for top 100 repos (500)
#Refresh the cache that sorts them periodically.
big_projects = ['bootstrap']
#Build a class object of the repo and cache that.
github = Github()
query_string = "bootstrap"
limit = 10
results = github.repos.search(query_string)
matches = [ (r.name, r.owner) for r in results[:limit]]
for name, owner in matches:
combo_name = "%s/%s" % (owner, name)
print combo_name
watchers = len(github.repos.watchers(combo_name))
open_issues = github.issues.list(combo_name, state="open")
closed_issues = github.issues.list(combo_name, state="closed")
print "%s has %s watchers." % (combo_name, watchers)
print "%s has %s open issues." % (combo_name, len(open_issues))
print "%s has %s closed issues." % (combo_name, len(closed_issues))