Skip to content

Instantly share code, notes, and snippets.

@chrismay
Forked from joneskoo/gist-backup.py
Last active August 29, 2015 14:07
Show Gist options
  • Save chrismay/a4719cb80c446950e913 to your computer and use it in GitHub Desktop.
Save chrismay/a4719cb80c446950e913 to your computer and use it in GitHub Desktop.
#!/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