Help - Search - Members - Calendar
Full Version: If you were importing RSS on your website..
Invision Power Services > Community Forums > Community Web Design and Coding
Danny
Ok, i'm writing a CMS script and I need help deciding how to handle my RSS imports. Here are the two choices:

1) Like IPB, the feed gets read, and then it inserts all of the feed's items into the database as news entries and puts those news entries in a special RSS category.

or

2) Like IP.Dynamic (I think), the feed's articles aren't inserted into the database, but rather a page just shows the live feed's articles parsed, and is updated every 5 visitors to that page.

Which would you rather use if your website was importing RSS, or if you have another idea, please tell me.
Wombat
QUOTE(Danny @ Jul 13 2005, 05:17 PM) *
Ok, i'm writing a CMS script and I need help deciding how to handle my RSS imports. Here are the two choices:

1) Like IPB, the feed gets read, and then it inserts all of the feed's items into the database as news entries and puts those news entries in a special RSS category.

or

2) Like IP.Dynamic (I think), the feed's articles aren't inserted into the database, but rather a page just shows the live feed's articles parsed, and is updated every 5 visitors to that page.

Which would you rather use if your website was importing RSS, or if you have another idea, please tell me.


Caching.

Parsing XML *can* be a fairly resource intensive procedure, so I'd recommend caching the results for a configurable period of time per RSS feed. By caching, I mean something as simple as storing the results in a text file, or a database. Whatever you see fit.

Personally I perform an MD5 of the RSS feed's url create a file with that name, and store the results in it. On each page, check if the file is over 1 hour old, and if it is, re-fetch the feed and cache the new results.
Danny
Ya I was going to use cache, but with the information, should I insert it (like IPB does with RSS import posts) or just show the cached feed without inserting it into the database as news articles.
Starnox
QUOTE
and is updated every 5 visitors to that page.
That sounds a bit stupid to me. It could be way out of date by the time the 5th visitor gets to it.
Danny
Ya, but a visitor still needs to visit before it re-caches anyway, and it could be super out of date by the time it re-caches if no one is visiting the website as well.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.