我使用githubapi来获取关于存储库上提交的JSON数据。你知道吗
链接到JSON文件:https://api.github.com/repos/ErinBailey/cs399-social/commits
我正在尝试获取所有致力于某个项目的用户的“id”。我该怎么做呢?现在我看到JSON文件的结构是sha/author/id
到目前为止,我的代码是:
r = requests.get('https://api.github.com/repos/ErinBailey/cs399-social/commits', auth=('cs399contributions', 'contributions399'))
input_log = json.loads(r.text)
print(json.dumps(input_log, indent=4))
user_ids = [x for x in input_log if x['sha/commit/author/id'] > '0']
output_json = json.dumps(user_ids,indent=4)
print output_json
这是我的密码。你知道吗
相关问题 更多 >
编程相关推荐