PHP Random rss feeds - selects 49 random feeds from an unlimited list and displays them on your website. It's Ideal for those moments when you got 5 minutes and dont know which one of your feeds to read.
This is my first post so i hope you like it.
The following selects 49 random feeds from an unlimited list and displays them on your website. It's Ideal for those moments when you got 5 minutes and dont know which one of your feeds to read. See it in action here : http://www.ozonew4m.com/random-webmaster-feeds.php
First of all lets pull all our rss urls from the text file and put them in an array
Next we create a nice little function that will jumble all our urls around inside the array and retrieve 49 random results in an array according to a paramaters we specify.
These are ($feedarray,$amounttoretrieve,randomkey)
Now we have the data we need call the function.The following tells the function we want 49 results randomised using our random key. (NOTE: A static key will yeild static results)
Now all we need to do is go through our array and display our reslts in a mystery graph so we can choose which one to read.
The following is optimised to display 7x7=49 results but you can display them how you wish.
<?php
$rows = 7;
$count = 0;
echo "<h1> Random rss News </h1>";
echo "<h2>Select any of the boxes below to view a news feed</h2>";
echo "<p>The following table retrieves a selection of 49 feeds from a growing list and displays them randomly. </p>";
echo "<table width='100%'><tr><td align='center'><b>Enjoy the Feeds</b><table cellpadding='10'><tr>";
foreach ($fred as $key) {
$count++;
echo "<td><a href='rssfeed.php?feed=$key'><img src='mysteryfeed.jpg'width='25'height='25'style='border: 0;'alt='feed $count' /></a></td>";
if ($count % $rows == 0) {
if ($count != 49) {
print "</tr><tr>";
}
}
if ($count == 49) {
print "</tr>";
}
}
echo "</table><p><a href='feedslist.php'>View a complete list of feeds.</a><br /></p>";
echo "</td></tr></table>";
?>
If you download the zip file it also contains a page to display the feeds, a list off webmaster feeds, a page to display a full list of your feeds