Skip to content

Instantly share code, notes, and snippets.

@nzwulfin
Created Mar 14, 2016
Embed
What would you like to do?
import requests, os
USER='nzwulfin'
#API_TOKEN=
GIT_API_URL='https://api.github.com'
api = GIT_API_URL + '/users/' + USER + '/repos?type=all'
def get_repos(url):
try:
result = requests.get(url)
for i in range(0, len(result.json())):
#print result.json()[i]['name']
if not os.path.isdir(result.json()[i]['name']):
print "Local copy of repo %s not found" % result.json()[i]['name']
except:
print 'Failed to get API result from %s' % url
get_repos(api)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment