Examples
curl
PHP
<!DOCTYPE html>
<html>
<head>
<title>TVH PHP test</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style>
table, th, td {
border: 1px solid black;
}
</style>
</head>
<body>
<table>
<tr><th>Date</th><th>Start</th><th>End</th><th>Title</th></tr>
<?php
$timers = get_timers();
foreach($timers as $t) {
$start = strftime("%H:%M", $t["start"]);
$stop = strftime("%H:%M", $t["stop"]);
$date = strftime("%a %e/%m", $t["start"]);
echo "<tr><td>$date</td><td>$start</td><td>$stop</td><td>{$t['disp_title']}</td></tr>";
}
function get_timers() {
$url = "http://admin:[email protected]:9981/api/dvr/entry/grid_upcoming?sort=start";
$json = file_get_contents($url);
$j = json_decode($json, true);
$ret = &$j["entries"];
return $ret;
}
?>
</table>
</body>
</html>
Javascript
Python
Last updated
Was this helpful?
