".substr($item->pubDate, 17, 8) .
" $item->title
$item->description ".(($aeg)?$item->pubDate:"")."\n";
}
?>
Uudised
channel->item as $item){
echo itemString($item, $nr);
$nr++;
}
echo "ERR
";
$juur=simplexml_load_file("http://uudised.err.ee/rss");
foreach($juur->channel->item as $item){
echo itemString($item, $nr, 1);
$nr++;
}
echo "Ilm
";
//Lisage lehe lõppu http://www.ilmateenistus.ee/ilma_andmed/xml/forecast.php
//4 päeva prognoos
$sisu=trim(file_get_contents("https://www.ilmateenistus.ee/ilma_andmed/xml/forecast.php", false, null, null, 1000000));
if(substr($sisu, -6) != "casts>"){
$sisu.="";
}
$juur=simplexml_load_string(utf8_decode($sisu));
// $juur=simplexml_load_file("https://www.ilmateenistus.ee/ilma_andmed/xml/forecast.php");
foreach($juur->forecast as $f){
echo "- ".$f->attributes()->date." ".
$f->night->tempmin. "..".$f->night->tempmax.", ".
$f->day->tempmin. "..".$f->day->tempmax." ".
$f->night->text."; ".$f->day->text.
"
";
$nr++;
}
?>