forked from RichmondMakerLabs/kml-tfl-countdown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
countdown.php
36 lines (32 loc) · 963 Bytes
/
countdown.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<html>
<head>
<title>KML countdown</title>
<meta http-equiv="refresh" content="32">
<meta name="viewport" content="width=device-width">
<meta name="apple-mobile-web-app-capable" content="yes" />
<style type="text/css" media="screen">
body {
background-color:#000;
color:#00CD00;
font-family: Tahoma, Geneva, sans-serif;
font-size:1.6em;
}
</style>
</head>
<body>
<?php
print("<br/>Buses on Ashburnham Road, Ham\n<br/>");
$urltoRichmond = "http://countdown.tfl.gov.uk/stopBoard/51750";
$urltoKingston = "http://countdown.tfl.gov.uk/stopBoard/56822";
foreach (array($urltoRichmond,$urltoKingston) as $url) {
$result= file_get_contents($url);
$info = (json_decode($result,true));
print("<br/>Last updated: " . $info['lastUpdated'] . ".\n<br/>" );
foreach ($info['arrivals'] as $bus ) {
print ("" . $bus['routeName'] . " to " .
$bus['destination'] . " " . $bus['estimatedWait'] . ".\n<br/>" );
}
}
?>
</body>
</html>