I see. Weird thing is that this worked before but just stopped now.
Okay, that makes sense. We were talking about caching this inside our API, but someone raised concerns about whether this data isn’t copyrighted. I suppose it isn’t at least for these purposes, or do you know something else?
Sure. We dont have a public repo but there are only two files for this. This HTML and then the gateways.php file:
<?php
if($_SERVER['REQUEST_METHOD'] === 'GET') {
$ch = curl_init();
if($ch === false) {
throw new Exception('failed to initialize');
}
curl_setopt($ch, CURLOPT_URL, 'https://www.thethingsnetwork.org/gateway-data/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$response = curl_exec($ch);
if ($response === false) {
throw new Exception(curl_error($ch), curl_errno($ch));
}
echo $response;
}
?>
I hope that this format is okay.