Retrieve news feeds (new version)
Yes thats right we have another news feed script and this one is a big improvement (less code) . Anyway without further ado lets take a look at the script . By the way this uses our new news feed which is located at myscripting.rss
<?php
$xmlfile = fopen("myscripting.rss", "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='2'>latest news</th>";
for($i=1 ; $i<=$count-1 ;$i++)
{
ereg("<title>(.*)</title>",$filechunks[$i], $title);
ereg("<link>(.*)</link>",$filechunks[$i], $links);
echo "<tr><td>";
echo $title[1];
echo "</td><td>";
echo "<a href ='$links[1]'\>$links[1]</a>";
echo "</td></tr>";
}
echo "</table>";
?> |