Created
March 14, 2016 15:52
-
-
Save nzwulfin/5888d08f8549beac0240 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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