Open sivashankerN opened 6 years ago
Following api displays details of each repository of the organization https://api.github.com/orgs/vlabs-on-openedx/repos
for more details about github apis see this page https://api.github.com/
Following api displays the details of each repository of the organization and the "per_page=200" gives the number of repositories to be displayed in a page. https://api.github.com/orgs/vlabs-on-openedx/repos?per_page=200
written python script to list down the repositories to be cloned. https://github.com/vlead/build-vlabs-on-openedx/commit/695e6f6a436546c11b819a4dee2cc662f13eedd9
Following api to clone all repositories in one organization.
curl -s https://api.github.com/users/[username]/repos?per_page=200 | python -c $'import json, sys, os\nfor repo in json.load(sys.stdin): os.system("git clone " + repo["clone_url"])'
Following python code used to tar the git repositories :
`import tarfile
with tarfile.open( folder_path + ".tar.gz", "w:gz" ) as tar:
for name in os.listdir( path ):
tar.add(name)`
Below code downloads the files from web using wget in python
`import os
os.system("wget https://api.github.com/orgs/vlabs-on-openedx/repos?per_page=92")`
clone all repositories from vlabs-on-openedx organization using github apis