In [1]:
import requests, json, github, time, itertools
from requests.auth import HTTPBasicAuth


Using matplotlib backend: module://IPython.kernel.zmq.pylab.backend_inline

Features list:

  • automatically star repositories?
  • see a list of commits from users (or at the very least see that a particular user committed)
  • send same comment to all users?
  • sent all users template code
  • groups of users (for different assignments / classes / whatever)

In [2]:
custom_headers = {'User-Agent': 'mprat'}
r = requests.get("https://api.github.com/repositories", headers=custom_headers)
json = r.json()
r.headers

In [1]:
# json_return = r.json()
# for repo in json_return:
#     commit_count_params = {'full_name': repo[u'full_name']}
#     commit_count_request = requests.get("https://api.github.com/repos/" + commit_count_params['full_name'])
#     rating = commit_count_request.json()['watchers_count'] + commit_count_request.json()['forks_count'] - commit_count_request.json()['open_issues']/ 5
#     #need to make this binary insert into
#     id_rank[commit_count_params['full_name']] = rating

In [4]:
def write_to_file(contents, filename):
    with open(filename + ".txt", 'a') as f:
        f.write(contents + "\n")

# write_to_file("test", "one")
# write_to_file("test2", "one")

In [5]:
g = github.Github("fdc3f237a674e40ac8c3af9944424c5432243262")
allrepos = g.get_repos()

In [7]:
file_to_write_to = ""