RSS във моя сайт.

gamena007

Registered
Здравейте!

Някой може ли да ми даде някакъв скрип да си го добавя към някоя страница за да ми излиза това от rss-а: http://www.ipo.bg/RSS.aspx?type=1

Демек нещо като на Аренабг.
 
http://www.web-tourist.net/forum/viewtopic.php?t=11755
Код:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?php
$xmlfile = fopen("http://www.ipo.bg/RSS.aspx?type=1", "r");
if(!$xmlfile)die("cannot open the xml file");
$readfile = fread($xmlfile ,40000);
$searchfile = eregi("<item>(.*)</item>", $readfile ,$arrayreg);
$filechunks = explode("<item>", $arrayreg[0]);
$count = count($filechunks);
echo "<table border='1'>";
echo "<th colspan='3'>latest news</th>";
for($i=1 ; $i<=$count-1 ;$i++)
{
ereg("<title>(.*)</title>",$filechunks[$i], $title);
ereg("<link>(.*)</link>",$filechunks[$i], $links);
ereg("<description>(.*)</description",$filechunks[$i],$desc);
echo "<tr><td>";
echo $title[1];
echo "</td><td>";
//echo "<a href ='$links[1]'>$links[1]</a>";
echo "</td><td>";
//echo $desc[1];
echo "</td></tr>";
}
echo "</table>";
?>
 

Back
Горе