diff options
Diffstat (limited to 'includes/refresh.php')
-rw-r--r-- | includes/refresh.php | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/includes/refresh.php b/includes/refresh.php index b6e95df..69ab51d 100644 --- a/includes/refresh.php +++ b/includes/refresh.php @@ -6,7 +6,17 @@ $descriptions = json_decode(file_get_contents("./descriptions.json"), true); $projects = []; print("Gitea > equestria.dev\n"); -$gitea = json_decode(file_get_contents("https://git.equestria.dev/api/v1/orgs/equestria.dev/repos?limit=1000&token=" . $secrets["gitea"], false, stream_context_create(["ssl"=>["verify_peer"=>false,"verify_peer_name"=>false]])), true); + +$gitea = []; +$page = 1; +$current = json_decode(file_get_contents("https://git.equestria.dev/api/v1/orgs/equestria.dev/repos?limit=1000&page=$page&token=" . $secrets["gitea"], false, stream_context_create(["ssl"=>["verify_peer"=>false,"verify_peer_name"=>false]])), true); +array_push($gitea, ...$current); + +while (count($current) > 0) { + $page++; + $current = json_decode(file_get_contents("https://git.equestria.dev/api/v1/orgs/equestria.dev/repos?limit=1000&page=$page&token=" . $secrets["gitea"], false, stream_context_create(["ssl"=>["verify_peer"=>false,"verify_peer_name"=>false]])), true); + array_push($gitea, ...$current); +} foreach ($gitea as $project) { if ($project["private"]) continue; @@ -44,7 +54,16 @@ foreach ($gitea as $project) { print("Gitea > minteck.org\n"); -$minteckorg = json_decode(file_get_contents("https://git.equestria.dev/api/v1/orgs/minteck.org/repos?limit=1000&token=" . $secrets["gitea"], false, stream_context_create(["ssl"=>["verify_peer"=>false,"verify_peer_name"=>false]])), true); +$minteckorg = []; +$page = 1; +$current = json_decode(file_get_contents("https://git.equestria.dev/api/v1/orgs/minteck.org/repos?limit=1000&page=$page&token=" . $secrets["gitea"], false, stream_context_create(["ssl"=>["verify_peer"=>false,"verify_peer_name"=>false]])), true); +array_push($minteckorg, ...$current); + +while (count($current) > 0) { + $page++; + $current = json_decode(file_get_contents("https://git.equestria.dev/api/v1/orgs/minteck.org/repos?limit=1000&page=$page&token=" . $secrets["gitea"], false, stream_context_create(["ssl"=>["verify_peer"=>false,"verify_peer_name"=>false]])), true); + array_push($minteckorg, ...$current); +} foreach ($minteckorg as $project) { if ($project["private"]) continue; |