2020-06-18 06:21:52 +00:00
|
|
|
<?php
|
2020-06-23 05:25:49 +00:00
|
|
|
date_default_timezone_set("UTC");
|
2020-06-18 06:21:52 +00:00
|
|
|
include '../header.php';
|
2020-06-23 05:25:49 +00:00
|
|
|
include 'apikey.php';
|
|
|
|
|
|
|
|
if (empty($apikey)) {
|
|
|
|
die("missing api key");
|
|
|
|
}
|
|
|
|
$context = stream_context_create([
|
|
|
|
"http" => [
|
|
|
|
"method" => "GET",
|
|
|
|
"header" => "X-API-Key: $apikey\r\n"
|
|
|
|
]
|
|
|
|
]);
|
|
|
|
|
|
|
|
$wk_begin = date("Y-m-d\TH:i:s\Z", strtotime("last sunday"));
|
|
|
|
$wk_end = date("Y-m-d\TH:i:s\Z", strtotime("next sunday"));
|
|
|
|
|
|
|
|
$schedule = json_decode(
|
|
|
|
file_get_contents(
|
|
|
|
"https://radio.tildeverse.org/api/station/1/streamers/schedule?start=$wk_begin&end=$wk_end&timeZone=UTC",
|
|
|
|
false,
|
|
|
|
$context
|
|
|
|
),
|
|
|
|
true
|
|
|
|
);
|
2020-06-18 19:36:12 +00:00
|
|
|
|
|
|
|
function formatdate($date) {
|
2020-06-23 05:55:03 +00:00
|
|
|
return date("D dd M H:i", strtotime($date));
|
2020-06-18 19:36:12 +00:00
|
|
|
}
|
2020-06-18 06:21:52 +00:00
|
|
|
?>
|
|
|
|
|
|
|
|
<h1><a href="https://tilderadio.org"><img style="width:75px;" src="../logos/tilderadio-green.png">tilderadio.org</a></h1>
|
|
|
|
<h4>upcoming broadcasts</h4>
|
2020-06-22 14:05:20 +00:00
|
|
|
<p>all times in UTC. current time is <?=formatdate("now")?>.</p>
|
2020-06-18 06:21:52 +00:00
|
|
|
|
2020-06-18 19:36:12 +00:00
|
|
|
<table class="table table-striped">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>dj</th>
|
|
|
|
<th>time</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<?php foreach ($schedule as $item): ?>
|
|
|
|
<tr>
|
2020-06-23 05:25:49 +00:00
|
|
|
<td><?=$item["title"]?></td>
|
2020-06-18 19:36:12 +00:00
|
|
|
<td><?=formatdate($item["start"])?> - <?=formatdate($item["end"])?></td>
|
|
|
|
</tr>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2020-06-18 04:07:03 +00:00
|
|
|
|
|
|
|
<?php include '../footer.php'; ?>
|