From ff783f41da1976d4cc4bc4e8e01691bc91adf30d Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Fri, 23 Feb 2024 17:03:51 +0100 Subject: [PATCH] Add `{main,config}.py` --- config.py | 1 + main.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 config.py create mode 100644 main.py diff --git a/config.py b/config.py new file mode 100644 index 0000000..53b1286 --- /dev/null +++ b/config.py @@ -0,0 +1 @@ +TOKEN = 'YOUR_TOKEN' \ No newline at end of file diff --git a/main.py b/main.py new file mode 100644 index 0000000..f25b442 --- /dev/null +++ b/main.py @@ -0,0 +1,15 @@ +import requests +import json +import config + +GITEA_INSTANCE = 'https://gitea.lemnoslife.com' + +headers = { + 'Authorization': f'token {config.TOKEN}' +} + +url = f'{GITEA_INSTANCE}/api/v1/repos/Benjamin_Loison/Synchronous_reactive_systems/collaborators' + +collaborators = requests.get(url, headers = headers).json() + +print(json.dumps(collaborators, indent = 4)) \ No newline at end of file