clone_all_repositories/clone_all.py

15 lines
556 B
Python

import requests # must install this module with pip or package manager
from git import Repo # must install gitpython module
def main():
# Perform request
token = "25135836368a30b70cbaa4aa56e8a40f04bf6030"
r = requests.get("https://git.franv.site/api/v1/repos/search?limit=80") #the 80 is to get all repos (presently 41)
# Loop through each repository returned, cloning it
for repository in r.json()["data"]:
Repo.clone_from(repository["clone_url"], "repos/" + repository["full_name"])
if __name__ == "__main__":
main()