forked from jennielees/oh-no-broken-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub.py
More file actions
32 lines (19 loc) · 827 Bytes
/
github.py
File metadata and controls
32 lines (19 loc) · 827 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
32
# I'm so close with this one.. I've got it to print out some stuff I got
# from the GitHub API, but not what I want!
# I saved the API stuff in a file to save time! :-)
import json
def github_api_response():
with open('github.json') as f:
github = json.loads(f.read())
return github
def print_user_repository_names():
# I just want to print out the names and descriptions of the repositories..
# like 'Hackbright-Curriculum: Exercises for the Hackbright Academy Fellowship Program'
repos = github_api_response()
for repo in repos:
repo_name = repo['name']
repo_desc = repo['description']
print repo_name + " " + repo_desc
#print repo['repo_description']
if __name__=="__main__":
print_user_repository_names()