Skip to content

Instantly share code, notes, and snippets.

@SunDi3yansyah
Forked from joneskoo/gist-backup.py
Created October 26, 2015 02:38
Show Gist options
  • Save SunDi3yansyah/08e4cb03b1f671c64329 to your computer and use it in GitHub Desktop.
Save SunDi3yansyah/08e4cb03b1f671c64329 to your computer and use it in GitHub Desktop.
Clone all my gists automatically (gist backup?)
#!/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