Skip to content

Instantly share code, notes, and snippets.

@gamesbrainiac
Created July 22, 2013 20:17
Show Gist options
  • Save gamesbrainiac/6057255 to your computer and use it in GitHub Desktop.
Save gamesbrainiac/6057255 to your computer and use it in GitHub Desktop.
Super awesome python code.
import requests
def get_raw_repo_data(username):
"""
Creates a connection to api.github.com through HTTPS
"""
print('starting')
CONNECTION_DETAILS = {
"host": "https://api.github.com",
"path": "/users/" + username + "/repos",
}
repositories = requests.get(CONNECTION_DETAILS['host'] + CONNECTION_DETAILS['path'])
# repositories = json.loads(repositories.json()[0])
return repositories.json()
repos = get_raw_repo_data('gamesbrainiac')
for var in repos:
print(var['name'])
print("Number for Repositories", len(repos))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment