From 76ae9d571dca532fb325a4e2af05ef06d20bf728 Mon Sep 17 00:00:00 2001 From: fossilfranv Date: Sat, 18 Feb 2023 20:37:16 +0100 Subject: [PATCH] first --- clone_all.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 clone_all.py diff --git a/clone_all.py b/clone_all.py new file mode 100644 index 0000000..9d6ed0d --- /dev/null +++ b/clone_all.py @@ -0,0 +1,16 @@ +import requests # must install this module with pip or package manager +from git import Repo # must install gitpython module + +def main(): + # Perform request + userid = "fossilfranv" + passw = "mUlUmuqi#$%" + token = "25135836368a30b70cbaa4aa56e8a40f04bf6030" + r = requests.get("https://git.franv.site/api/v1/repos/search?token=" + token) + + # 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()