Juli... eu precisei ontem tb e consegui esse aqui!! Muito bom!
O Link rss q esta ai é do G1 Noticias mas vc pode alterar. e esta limitado para mostrar as ultimas 5 mas pode mudar!
Segue abaixo o cod.. salve como qlq coisa.php
----------------------------------------------------------------------------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR...nsitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Rss!</title>
<meta name="description" content=" www.quemfaz.com.br - A Maneira + Fácil de se ter um site!" />
<style type="text/css">
<!--
.style2 {
font-family: arial;
font-size: 10px;
}
a:link {
text-decoration: none;
color: #990000;
}
a:visited {
text-decoration: none;
color: #990000;
}
a:hover {
text-decoration: none;
color: #FF0000;
}
a:active {
text-decoration: none;
color: #FF0000;
}
-->
</style>
</head>
<body>
<table width="430" border="0" cellspacing="3" cellpadding="0">
<tr>
<td>
<?php //www.quemfaz.com.br
ini_set('zend.ze1_compatibility_mode', 0);
## Caminho para o RSS do blog da Hostnet
$StFonteRSS = '
http://g1.globo.com/Rss2/0,,AS0-5597,00.xml'; // Link do RSS / FEED
## Converte um arquivo XML em um objeto
$XML = simplexml_load_file( $StFonteRSS );
## Lista o conteúdo do arquivo RSS
foreach ( $XML->channel->item as $item )
{
print '<tr><td><span class="style2">' .
date('d/m/Y h:i:s',strtotime(utf8_decode($item->pubDate))) .
'</span></td></tr>' . '<tr><td><span class="style2"><a class="link" href="' .
utf8_decode($item->link) . '"target="_blank">' .
utf8_decode($item->title) . '</a><br /></span></td></tr>';
$ItContado++;
if ($ItContado >= 5)
break;
}
?></td>
</tr>
</table>
</body>
</html>
Edição feita por: jamsbboy, 10/03/2009, 12:19.