Skip to content

Instantly share code, notes, and snippets.

@nzwulfin
Created March 14, 2016 15:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nzwulfin/5888d08f8549beac0240 to your computer and use it in GitHub Desktop.
Save nzwulfin/5888d08f8549beac0240 to your computer and use it in GitHub Desktop.
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