Script para noticias no formato rss
Publicado por Ricardo Franzen 15/12/2003
[ Hits: 13.900 ]
Homepage: http://rfranzen.com.br
Este script busca arquivos rss de sites e pré-formata para sua pagina :)
Este ja está com alguns sites...
<form action="news.php" method="get">
<div id="menu_notice" style="position:absolute; left:400px; top:0px; width:600px; height:414px; z-index:4">
<select size="1" name="news">
<option value="0"> Selecione um site </option>
<option value="7"> Noticias Linux </option>
<option value="12">LinuxSecurity </option>
<option value="2"> PontoBR </option>
<option value="3"> Linux in Brasil </option>
<option value="4"> Olinux </option>
<option value="5"> Linux dicas </option>
<option value="6"> Gildot </option>
<option value="8"> Slashdot </option>
<option value="1"> Securityx </option>
<option value="13">Plantao Info </option>
<option value="9"> Magnet </option>
<option value="10">MyFreeBSD </option>
<option value="11">RNP </option>
</select>
<input type="submit" value="Ver noticias">
</div>
</form>
<?
if ($_GET["news"] == null) {$frss = 'http://www.noticiaslinux.com.br/rss.php'; $lnk = 'http://www.noticiaslinux.com.br'; $home = 'Noticias em Noticias Linux';};
if ($_GET["news"] == "0") {$frss = 'Escolha de qual site que você quer ver as noticias'; $lnk = 'http://fit.faccat.br/~franzen/news.php'; $home = 'Selecione um site de noticias';};
if ($_GET["news"] == "1") {$frss = 'http://www.securityx.com.br/backend.php'; $lnk = 'http://www.securityx.com.br'; $home = 'Noticias em Securityx';};
if ($_GET["news"] == "2") {$frss = 'http://pontobr.org/backend/pontobr_rdf.php'; $lnk = 'http://pontobr.org'; $home = 'Noticias em PontoBR';};
if ($_GET["news"] == "3") {$frss = 'http://brlinux.linuxsecurity.com.br/noticias/index.rdf'; $lnk = 'http://brlinux.linuxsecurity.com.br'; $home = 'Noticias em Linux in Brasil';};
if ($_GET["news"] == "4") {$frss = 'http://rss.phpnuke.org.br/xml.php/olinux.xml'; $lnk = 'http://www.olinux.com.br'; $home = 'Noticias em Olinux';};
if ($_GET["news"] == "5") {$frss = 'http://www.linuxdicas.com.br/backend.php'; $lnk = 'http://www.linuxdicas.com.br'; $home = 'Noticias em Linux dicas';};
if ($_GET["news"] == "6") {$frss = 'http://gildot.org/gildot.rdf'; $lnk = 'http://gildot.org'; $home = 'Noticias em Gildot';};
if ($_GET["news"] == "7") {$frss = 'http://www.noticiaslinux.com.br/rss.php'; $lnk = 'http://www.noticiaslinux.com.br'; $home = 'Noticias em Noticias Linux';};
if ($_GET["news"] == "8") {$frss = 'http://slashdot.org/index.rss'; $lnk = 'http://slashdot.org'; $home = 'Noticias em Slashdot';};
if ($_GET["news"] == "9") {$frss = 'http://www.magnet.com.br/bits/recentes.rdf'; $lnk = 'http://www.magnet.com.br'; $home = 'Noticias em Magnet';};
if ($_GET["news"] == "10") {$frss = 'http://www.myfreebsd.com.br/backend.php'; $lnk = 'http://www.myfreebsd.com.br'; $home = 'Noticias em MyFreeBSD';};
if ($_GET["news"] == "11") {$frss = 'http://www.rnp.br/noticias/rss.xml'; $lnk = 'http://www.rnp.br/noticias'; $home = 'Noticias em RNP';};
if ($_GET["news"] == "12") {$frss = 'http://www.linuxsecurity.com.br/share.php'; $lnk = 'http://www.linuxsecurity.com.br'; $home = 'Noticias em LinuxSecurity';};
if ($_GET["news"] == "13") {$frss = 'http://info.abril.com.br/aberto/infonews/rssnews.xml'; $lnk = 'http://info.abril.com.br/aberto/infonews'; $home = 'Noticias em Plantao Info';};
?>
<div id="notic_linx" style="position:absolute; left:290px; top:85px; width:450px; height:300px; z-index:4;">
<table width="100%" border="0" bordercolor="#333333">
<tr>
<td height="10" bordercolor="#000000" bgcolor="#333333"><div align="left"><font color="#FFCC00" size="2" font"Verdana"><? echo $home; ?></font></td>
</tr>
<tr>
<td height="100" bordercolor="#000000"><div align="left"><font color="#CCCCCC" size="1" face="Verdana">
<?
$matches = array();
$rss = join("",file($frss));
$eng ="/<title>(.*?)<\/title>\n(.*?)<link>(.*?)<\/link>/";
preg_match_all($eng,$rss,$matches);
for($i = 1; $i < sizeof($matches[0]); $i++ ) {
echo "<a href=\"".$matches[3][$i]."\">".$matches[1][$i]."</a><br />";
}
echo "<br /><a href=\"$lnk\">Mais notícias no site...</a>";
?>
</td>
</tr>
</table>
</div>
Bluefin - A nova geração de ambientes de trabalho Linux
Como atualizar sua versão estável do Debian
Cirurgia para acelerar o openSUSE em HD externo via USB
Pós-instalação do elementary OS 8.1
Quer auto-organizar janelas (tiling) no seu Linux? Veja como no Plasma 6 e no Gnome
Copiando caminho atual do terminal direto para o clipboard do teclado
archlinux resolução abaixou após atualização (18)
Conky não mostra temperaturas da CPU no notebook (7)
Estou com um problema no meu desktop do ubuntu (2)
Não estou conseguindo fazer funcionar meu Postfix na versão 2.4 no Deb... (0)









