master
Raw Download raw file
 1import requests
 2import json
 3import os
 4from subprocess import call
 5
 6page = 1
 7i=0
 8while (i<629):
 9
10    payload = { 'page': page ,'per_page' : '100' }
11    r = requests.get('https://api.github.com/users/mbostock/gists', params=payload)
12    print r.json()
13    break
14    for gist in r.json():
15        print gist['id']
16        gistd = gist['id']
17        if os.path.isdir(gistd):
18            os.chdir(gistd)
19            call(['git', 'pull', 'git://gist.github.com/' + gistd + '.git'])
20            os.chdir(startd)
21        else::
22            call(['git', 'clone', 'git://gist.github.com/' + gistd + '.git'])
23        i = i+ 1
24    print i
25    page = page + 1
26print i