Created
May 14, 2021 20:28
-
-
Save brosahay/5c82dc052328171710e447dca516d6c2 to your computer and use it in GitHub Desktop.
Clone all my gists automatically (gist backup?)
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 python | |
# Git clone all my gists | |
import json | |
import urllib | |
from subprocess import call | |
from urllib import urlopen | |
import os | |
USER = os.environ['USER'] | |
u = urlopen('https://gist.github.com/api/v1/json/gists/' + USER) | |
gists = json.load(u)['gists'] | |
for gist in gists: | |
call(['git', 'clone', 'git://gist.github.com/' + gist['repo'] + '.git']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment