Forum Moderators: coopster

Message Too Old, No Replies

Archiving Parsed RSS

how do I save an RSS feed as a file once a day?

         

CliffR

6:27 am on Aug 19, 2004 (gmt 0)

10+ Year Member



I'm messing around with RSS feeds and I've found a pretty good PHP script to parse RSS feeds and display them on my site. The next step is to figure out a way to take a feed that's updated daily and save the resulting page as a file. So for example if I display headlines from several different RSS feeds on a single page on Auguest 19, 2004, I'd like to save that page each day and name it something like 081904.php. Then I want to create an archive page with a linked list of past days pages. My thinking is that if you're syndicating RSS to get content on your site, the volume of content you have never increases unless you have an archive system.

The trouble I'm having is that this is all so new to me I don't know how to search for this information other than to describe it here. Can anyone point me in the right direction?

Regards,
CliffR

coopster

10:51 pm on Aug 19, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, CliffR!

You could use your operating system's job scheduler to kick off a daily process to

  1. fetch the feed,
  2. save it, possibly using PHP's Date and Time Functions [php.net] to format the filename,
  3. then loop through a *current* directory and compare files to see whether or not they should be moved to the *archive* directory.

Netizen

1:15 pm on Aug 20, 2004 (gmt 0)

10+ Year Member



Personally I'd dump the RSS feeds into a database with the URL as the unique key. Then you could pull out the articles for any particular day. Otherwise on low volume sites you'll get many duplicates and on high volume sites you'll miss articles.

Just my $0.02 worth.