1,
CURLOPT_URL => $url,
CURLOPT_USERAGENT => 'RNV DesktopWidget v1.0.0',
CURLOPT_HTTPHEADER => array(
"Accept: application/json"
)
));
$result = curl_exec($curl);
curl_close($curl);
return json_decode($result, true);
}
$hafasID = (isset($_GET['id'])) ? $_GET['id'] : 5548; //default alte feuerwache
//get station data
$station = get_curl('http://rnv.the-agent-factory.de:8080/easygo2/rest/regions/rnv/modules/stations/packages/1');
//get current arrival times
$timetable = get_curl('http://rnv.the-agent-factory.de:8080/easygo2/rest/regions/rnv/modules/stationmonitor/element?hafasID='.$hafasID.'&time=null');
//parse out the correct station name
$station_name = '';
foreach($station['stations'] as $s) {
if($s['hafasID'] == $hafasID) $station_name = $s['longName'];
}
if(empty($station_name)) $station_name = 'Unbekannt';
?>
RNV
= $station_name ?>
= $dep['lineLabel'] ?> |
= $dep['direction'] ?> |
= $dep['differenceTime'] ?> min |