Last active
October 31, 2018 10:49
-
-
Save cvengler/926392371cdcabb58cbd36d723e5aca4 to your computer and use it in GitHub Desktop.
Download a GitHub User with all repos. Usage: python3 githubuser.py <username>
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 urllib.request | |
import json | |
import sys | |
import os | |
user = sys.argv[1] | |
url = "https://api.github.com/users/" + user + "/repos" | |
urllib.request.urlretrieve(url, "json.json") | |
i = 0 | |
file = open("json.json", "r") | |
json = json.load(file) | |
file.close() | |
while True: | |
try: | |
os.system("git clone https://github.com/" + user + "/" + json[i]["name"] + ".git") | |
except: | |
print("Done") | |
break | |
i = i + 1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment