Hi,
In this script I need to be modified so that the rss feeds to be in an external txt file without any code. The file can be named i.e. feeds.txt and the script will look in this file and grab 1 feed at the time. If there is an easy way to take more than one feed at the time it would be better. Also in the code there is a part that says to the script how many feeds are in the txt file. Can this be set that way so that I don't have to count every time the number of the feeds in the file?
<?php
$rssnew = array(
"http://www.marktplaats.nl/markt/telecommunicatie/samsung.xml",
"http://www.marktplaats.nl/markt/telecommunicatie/sony.xml",
"http://www.marktplaats.nl/markt/telecommunicatie/motorola.xml",
"http://www.marktplaats.nl/markt/telecommunicatie/sagemgsm.xml",
"http://www.marktplaats.nl/markt/telecommunicatie/mitsubishi.xml",
"http://www.ringtonesavvy.com/news/cutenews/rss.php",
"http://rss.wirelessmedia.com/charts.rss"
);
srand(time());
$random = (rand()%7);// 7 is the number of feeds above
//store the random feed in the $randomfeed variable
$randomfeed = $rssnew[$random];
//this is your newsfeed , you can use any rss file here
$rssfile = fopen("$randomfeed", "r");
//if file doesnt exist , quit
if(!$rssfile)die("Can't open rss feed:");
//read in 80000 bytes of the $rssfile
$readfile = fread($rssfile ,80000);
//search for the
$searchfile = eregi("<item>(.*)</item>", $readfile ,$arrayreg);
$filechunks = explode("<item>", $arrayreg[0]);
$count = count($filechunks);
//build our table
echo "<table border='0'>";
for($i=1 ; $i<=$count-1; $i++)
{
ereg("<title>(.)</title>",$filechunks[$i], $title);
ereg("<description>(.)</description>",$filechunks[$i], $description);
ereg("<link>(.*)</link>",$filechunks[$i], $links);
echo "<tr><td>";
//display all the titles
echo "<h3><strong>", $links[1];
echo "</td></strong></h3>";
//display all the titles
echo "<h3><strong>", $title[1];
echo "</td></strong></h3>";
//display Description
echo "<h3>", $description[1];
echo "</td></tr></h3>";
}
echo "</table>";
?>
Thanks for your time in advance
James