Generating RSS Feed

Status
Not open for further replies.

B-Man88

Ars Scholae Palatinae
701
I'm looking for as simple a solution as possible to the following problem: we'd like to generate a RSS feed from the contents in a directory on our web server. The contents in the directory are news stories. When a new news story is saved to the directory, we want it to automatically be generated into an RSS feed. We'd still like a few controls (display only X stories, etc.). Any possible solutions?

Thanks in advance.
 

elvispresly2k

Ars Scholae Palatinae
1,411
Read directory files into array with PHP/CI:
http://codeigniter.com/user_guide/helpe ... elper.html

Loop the array, reading in each file's contents, building an appropriately formatted block of RSS from said contents, breaking the loop after "X" is reached:
http://codeigniter.com/user_guide/helpe ... elper.html

Then print the "$myRSSBlock" you've created.
Be sure to add the correct header before you print!
Code:
header ("Content-type: text/xml");
 
Status
Not open for further replies.