Skip to content

Instantly share code, notes, and snippets.

@mrandi
Last active February 18, 2016 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrandi/e64ac304788d858ce9cc to your computer and use it in GitHub Desktop.
Save mrandi/e64ac304788d858ce9cc to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
from pprint import pprint
import requests
import json
import os
USER='XXX'
API_TOKEN='XXX'
GIT_API_URL='https://api.github.com'
def get_api(url):
try:
headers = {'Authorization': 'token %s' % API_TOKEN}
response = requests.get(GIT_API_URL + url, headers=headers)
for element in response.json():
pprint(element['ssh_url'])
cmd = 'git clone ' + element['ssh_url']
os.system(cmd)
except:
pprint("Exception %s" % url)
raise e
def get_repo():
pprint("get Org for stups")
get_api("/orgs/:org/repos")
get_repo()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment