Mixing Rss, Php And Static Pages

admin

Administrator
Staff member
I would like to include an RSS feed from my forum on one of my main pages. Since it's so traffic heavy, I'd like to avoid that page being PHP and processing the RSS feed each and every time the page is called. I'd like to set up a cron job to update the page every six hours or so.<br /><br />But how would I get the RSS feed from the forum, then parse that and inject it into a static page - all done via a php script called from cron?<br /><br />Or maybe I've misunderstood the question and there's a simpler way to do it?<!--content-->
Found something I might be able to modify:<br /><br /><a href="http://www.wirelessdevnet.com/channels/wap/features/xmlcast_php.html" target="_blank">http://www.wirelessdevnet.com/channels/wap...mlcast_php.html</a><br /><br />But that's just the first stage. I still need to inject the results into a static HTML page.<!--content-->
annie,<br /><br />Maybe <a href="http://magpierss.sourceforge.net/" target="_blank">Magpie</a> can help you?<!--content-->
I was also looking at this. If that's all it takes, it's blindingly simpler than I anticipated:<br /><br /><a href="http://www.experts-exchange.com/Web/Web_Languages/PHP/PHP_Databases/Q_20881512.html" target="_blank">http://www.experts-exchange.com/Web/Web_La...Q_20881512.html</a><!--content-->
Thanks, Lisa. I was able to modify the script from wirelessdev easily, and it worked really well. So I'll be using that since I already whipped it into shape.<!--content-->
Tried this via cron:<br />wget -O yourscript.html <a href="http://localhost/yourscript.php" target="_blank">http://localhost/yourscript.php</a><br /><br />Got e-mail back:<br />/usr/local/bin/php: Permission denied<br /><br />What gives?<!--content-->
I think that you need the actual url to your site, not localhost... or the path to the file, either way. =)<!--content-->
I did, that's just the pattern I used when preparing the string. It looks way different in reality.<br /><br />Never mind, when I copied the path from somewhere else, I appended the path to PHP... I'll try again without that!<!--content-->
Did you have a look at the error files? Perhaps the .php file you are actioning needs to be chmod'd - those error logs would be the best way to ascertain that....<!--content-->
Nothing enlightening in the error logs. That's my first place to check. Probably failed at a much earlier level.<br /><br />This time mail spit out this error message:<br /><br />/home/username/public_html/filename.htm: Unsupported scheme.<br /><br />I switched things around a bit, and now I think I'm on the right track. Got a very helpful error message. Turns out I need to switch around source and receiving file on the cron string.<br /><br />...and, it worked!<br /><br />See how I did it:<br /><br /><a href="http://www.totalchoicehosting.com/forums/index.php?showtopic=10476&hl=" target="_blank">http://www.totalchoicehosting.com/forums/i...topic=10476&hl=</a><!--content-->
 
Back
Top