//echo$_SERVER['HTTP_USER_AGENT'];
// echo 'ie ='.strpos($_SERVER['HTTP_USER_AGENT'], "MSIE 7");
// echo 'opera = '.strpos($_SERVER['HTTP_USER_AGENT'], "pera") ;
// echo 'Firefox = '.strpos($_SERVER['HTTP_USER_AGENT'], "Firefox") ;
//if(strpos($_SERVER['HTTP_USER_AGENT'], "MSIE 7") or strpos($_SERVER['HTTP_USER_AGENT'], "pera") or strpos($_SERVER['HTTP_USER_AGENT'], "Firefox") ){
// echo 'sono dentro' ;
require_once('rss/magpierss/rss_fetch.inc');
//Questo è l'URL del feed che andremo a parsare. Nell'esempio c'è il mio :-)
//$url = "http://www.ilmessaggero.it/rss/home.xml";
$url = "http://magazine.enel.it/meteo/inc/rss_tabella_risultati.asp?idComune=IT058091";
//apre il feed
$rss = fetch_rss ($url);
//Metto il titolo del feed in una variabile
$feedchanneltitle = $rss->channel['title'];
//Incominciamo un ciclo per ogni item
$nnotizie = $notizie;
$conta=0;
echo '
- ';
foreach ($rss->items as $item) {
//Qui potrei mettere dei controlli: se le variabili non sono vuote, ecc
$conta=$conta + 1;
if(!empty($item['description']) ) {
//Variabilizzo tutto
$itemlink = $item['link'];
$itemtitle = htmlentities($item['title']);
$pubdate = $item['pubdate'];
$description = ($item['description']);
//$description = htmlentities($item['description']);
//$description = str_replace("&"," &",$description );
//$description = str_replace(";","; ",$description );
$itemtitle = str_replace("&"," &",$itemtitle );
$itemtitle = str_replace(";","; ",$itemtitle );
$author = $item['author'];
$feedurl = $item['feedurl'] ;
$pubdate = strtotime ($pubdate);
//Formatto la stringa della data secondo i miei gusti
$pubdate = date("d/m/y H:i:s", $pubdate);
//Ora potrei cominciare a stampare il feed a video
echo '
- ';
echo ''.$pubdate.';
'; echo ''.$itemtitle.''; echo ''.($description).''; // Strip_tags è aggiunto per evitare di mostrare l'HTML eventualmente contenuto nell'articolo echo ""; echo ""; echo ""; echo ""; echo ''.strip_tags($description).''; echo ""; echo ""; echo ""; echo ""; echo " "; echo ' ';
} //chiudo eventuali controlli con IF
//}
} // chiudo il ciclo FOREACH ITEM
echo '