Created
July 3, 2022 02:14
-
-
Save h4sh5/96220d16fc8b3abe98b2c1217ef5ed3a to your computer and use it in GitHub Desktop.
clone gists to current dir
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| import json | |
| import urllib | |
| from subprocess import call | |
| #from urllib import urlopen | |
| from urllib.request import Request, urlopen | |
| import os | |
| import sys | |
| USER = sys.argv[1] #os.environ['USER'] # or edit as appropriate | |
| u = urlopen("https://api.github.com/users/%s/gists" % USER) | |
| gists = json.load(u) | |
| for gist in gists: | |
| print(gist) | |
| print('url:',gist['git_pull_url']) | |
| call(['git', 'clone', gist['git_pull_url']]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment