allow for remote development of schedule by pointing to live schedule json in dev
This commit is contained in:
parent
af00cded1e
commit
76c878d65a
|
@ -2,9 +2,14 @@
|
|||
include 'apikey.php';
|
||||
|
||||
if (empty($apikey)) {
|
||||
die("missing api key");
|
||||
}
|
||||
|
||||
/* If we don't have the API key, assume we're developing. Pull data from live version of this file */
|
||||
$context = stream_context_create([
|
||||
"http" => [
|
||||
"method" => "GET",
|
||||
]
|
||||
]);
|
||||
$schedule = json_decode(file_get_contents("https://tilderadio.org/schedule/schedule.php?json=yes", false, $context), true);
|
||||
} else {
|
||||
$context = stream_context_create([
|
||||
"http" => [
|
||||
"method" => "GET",
|
||||
|
@ -26,6 +31,7 @@ $schedule = json_decode(
|
|||
),
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
usort($schedule, function ($a, $b) {
|
||||
return $a["start"] <=> $b["start"];
|
||||
|
|
Loading…
Reference in New Issue