View Full Version : Need RSS help please!
heapseo
Nov 21st 2005, 5:12 am
I want to add rss feds to a new website. I have added rss feeds before using yfs1's excellent script but my needs are a bit more complex now.
Say a feed has 10 different articles, i want to be able to display a random number of those articles. (e.g. articles 2,5 and 6, or articles 6,8,11 etc). I dont even know if this is possible - if it is, could someone point me in teh direction of something/some code that can do it for me please.
thanks.
briandunning
Nov 21st 2005, 6:25 am
I don't know yfs1's script, but assuming it gives you the articles in a PHP array: you could generate another array of 3 or 4 random numbers out of ten, and then output your RSS something like this:
while($myArray = $counter)
{
echo $rssArray[$counter];
}
You could also just shuffle($rssArray) and then only display the first 3.
heapseo
Nov 21st 2005, 6:36 am
In his script there is an array which holds different feeds, not each article of one feed. What you are saying is exactly what I need though.
Yfs1's script is here http://forums.digitalpoint.com/showthread.php?t=7354
briandunning
Nov 21st 2005, 6:41 am
You might also want to look at Magpie, since that supports caching of RSS content, to either disk or MySQL. This lets you access each RSS source only once every so often - set it for whatever interval you want to refresh your site content. Note that if you don't locally cache RSS content, some providers will shut off your access for abuse, like when G spiders you and you get slammed, thus slamming their RSS server.
http://magpierss.sourceforge.net/
The MySQL caching option is a hack that you'll have to look around for. I use it, it's great.
heapseo
Nov 21st 2005, 6:51 am
I actually downloaded magpie rss earlier but to be honest don't hve the faintest clue what to do with it. I can't find anything that says about uploading it to a webserver, where to put which files etc and it doesn't seem hte easiest thing to figure out when u dont have a clue what your doing!
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.