Reputation:
I am in the process of creating my own product that acts like a Content Management System, in a way. I would like to include an RSS feed, although I'm not exactly sure how I would go about doing it.
I think it would be possible if I iterate through each post as its being built by my Build script and append it as an item into the XML file. Is there a more efficient or less costly way to achieve this?
I'm mainly using Ruby/Php/Haml, but I will also accept other languages (I'm willing to learn)
Upvotes: 0
Views: 1471
Reputation: 8961
I suggest to use a stack of x items. Every time a new post is added, you'll push it to the stack. At any given moment, you can view the stack. That's your feed.
Rails has an after_create
mechanism to identify when a new item has been added.
For the stack, I would recommend using Redis, which is very fast.
Upvotes: 1