Forum Moderators: coopster

Message Too Old, No Replies

Parsing a RSS feed and generating a static .html file with PHP

Small project for my site, please help.

         

DJQuanta

8:42 pm on Jun 30, 2005 (gmt 0)

10+ Year Member



Note: Ooops.. I just noticed that I made a mistake in the subject of the post, it should read: "Parsing a RSS feed and generating a static .html file with PHP"

Hi Guys,

I have this small project for my site, if you can't point me to some resources or help me out I'll thank you very much.

The homepage of my site points to the different services I offer (chats, forums, my blog and a podcast for spanish speakers). I want to make this homepage more dynamic, but since the homepage gets more than 10000 daily unique visitors I don't wanna make it a .php file ('cause my hosting provider might get mad with the server's resources).

So what I need is to program a php script that I would run on-demand (probably 1 or 2 times a day) and that would make this:

- Parse the RSS feed of my blogs and the forums
- Generate a static .html file (the homepage) with the normal content plus the headlines from the feeds.

That way everytime I update my blogs I could run that php script to re-generate the homepage, with the updated info from the feeds.

Any help, suggestions, comments, links on how to do this will be very helpful. I'm not very experienced with PHP (I come from J2EE development), but I'm armed with 2 PHP books as a reference.

Thanks in advance,

Quanta

Blackie

8:58 am on Jul 1, 2005 (gmt 0)

10+ Year Member



You can set up crond to run the php script automatically as much times as you need it.

1. to parse rss and forum make a google search for "file_get_contents php"
2. to generate .html, search for "write file php" you should get plenty of results.

If you get more questions on the way, post the code here :-)