Accueil/meteo.php

27 lines
1.1 KiB
PHP
Raw Normal View History

2010-09-14 23:38:29 +02:00
<?php
if ($weather = simplexml_load_file('http://www.my-meteo.fr/meteo+rss+paris.html')){
$present_weather = $weather->channel->item[0]->title;
$future_weather1 = $weather->channel->item[1]->title;
$future_weather2 = $weather->channel->item[2]->title;
if(strpos(strtolower($present_weather),"soleil") !== false) {?>
<link rel="stylesheet" type="text/css" href="css/soleil.css">
<?}
if(strpos(strtolower($present_weather),"nuage") !== false) {?>
<link rel="stylesheet" type="text/css" href="css/nuage.css">
<?}
if(strpos(strtolower($present_weather),"peu nuageux") !== false) {?>
<link rel="stylesheet" type="text/css" href="css/peunuage.css">
<?}
if((strpos(strtolower($present_weather),"pluie") !== false) || (strpos(strtolower($present_weather),"averse") !== false)) {?>
<link rel="stylesheet" type="text/css" href="css/pluie.css">
<?}
if(strpos(strtolower($present_weather),"neige") !== false) {?>
<link rel="stylesheet" type="text/css" href="css/neige.css">
<?}
}
else
{
die ('Flux RSS non trouvé');
}
?>