Tieinfo näytää olevan alhaalla joten Suomen tiesäädata ei ole päivittynyt sitten eilisen...
Eipä oo toiminut taas muutamaan päivään, ei ainakaan sivuille tuu tietoa.
Kyllä ainakin seuraava puskee dataa:
http://tieinfo.mustcode.fi/tieinfo/liikenne/tiedotteet/?json
ei tällä tuu mitään
http://tieinfo.mustcode.fi/tieinfo/saa/paikkakunta/joutsa?json
Huomasin juu kun kokeilin hakea säätietoja. Säätiedot näyttää olevan alhaalla.
taitaa olla tieinfo lopettanut kun ei oo toiminut vähään aikaan.
ei muuten mutta kun en osaa laittaa noita fmi:n tiesää arvoja sivuille.
Tuolla sen datan saa hauettua suoraan Digitrafficista/Liikennevirastolta:
<?php
//Soap-URL
$soapUrl = "http://open.digitraffic.fi/services/roadWeather"; // asmx URL of WSDL
// xml post
$xml_post_string = '<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sch="http://www.gofore.com/sujuvuus/schemas">
<soapenv:Header/>
<soapenv:Body>
<sch:RoadWeather/>
</soapenv:Body>
</soapenv:Envelope>';
$headers = array(
"DT-User-Agent: test",
"DT-Contact-Info: me"
);
$rfi = "/home/xxx/xxx/cache/roadWeather.soap";
if (file_exists($rfi) and (filemtime($rfi) + 600) > time()) {
$response = file_get_contents($rfi);
}else{
// PHP cURL
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $soapUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
file_put_contents($rfi, $response);
chmod($rfi, 0666);
}
$response1 = str_replace("<soap:Body>","",$response);
$response2 = str_replace("</soap:Body>","",$response1);
$parser = simplexml_load_string($response2);
$array = json_decode(json_encode((array)$parser), TRUE);
$data = $array[RoadWeatherResponse][roadweatherdata][roadweather];
?>