Commit 33a19ac2 authored by David Morley's avatar David Morley

use curl to test pods and error less when they are down

parent a392b317
Pipeline #824 passed with stage
in 4 minutes and 29 seconds
......@@ -83,8 +83,8 @@ EOF;
if (!$stop) {
$link = 'https://' . $_domain . '/nodeinfo/1.0';
if ($infos = file_get_contents('https://' . $_domain . '/.well-known/nodeinfo')) {
$info = json_decode($infos, true);
$nodeinfo = curl('https://' . $_domain . '/.well-known/nodeinfo');
if ($info = json_decode($nodeinfo['body'] ?: '', true)) {
$link = max($info['links'])['href'];
}
......
......@@ -31,7 +31,9 @@ $existingpods = array_column($pods, 'domain');
$foundpods = [];
//pulling all nodes for now
if ($pods = json_decode(file_get_contents('https://the-federation.info/graphql?query=%7Bnodes%7Bhost%20platform%7Bname%7Dprotocols%7Bname%7D%7D%7D&raw'), true)) {
$federationpods = curl('https://the-federation.info/graphql?query=%7Bnodes%7Bhost%20platform%7Bname%7Dprotocols%7Bname%7D%7D%7D&raw');
if ($pods = json_decode($federationpods['body'] ?: '', true)) {
;
foreach ($pods['data']['nodes'] ?? [] as $poddata) {
$protocols = array_column($poddata['protocols'] ?? [], 'name');
......@@ -42,7 +44,8 @@ if ($pods = json_decode(file_get_contents('https://the-federation.info/graphql?q
}
}
if ($pods = json_decode(file_get_contents('https://diasp.org/pods.json'), true)) {
$diasppods = curl('https://diasp.org/pods.json');
if ($pods = json_decode($diasppods['body'] ?: '', true)) {
foreach ($pods ?? [] as $poddata) {
$foundpods[] = strtolower($poddata['host']);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment