Version avec modules séparés !
This commit is contained in:
26
modules/weather/includes/meteo.php
Normal file
26
modules/weather/includes/meteo.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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é');
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user