|
Posted by Philip Ronan on 12/15/05 21:05
"Simon" wrote:
> Hi,
>
> I am trying to parse some RSS files on my site to give a bit of news.
> But some of the RSS are sometimes very old, (or just not updated anymore).
>
> Is there a way of getting the age, (last updated), of a remote file?
> I guess could always store the whole xml in the db and compare it every day
> to see when last it was updated.
> But I was hopping there might be an easier way.
>
> how can I tell how old the rss file really is?
I assume you're using the Curl library to fetch the RSS file. Try setting
CURLOPT_HEADER in a curl_setopt() command, and look for a Last-Modified
header in the returned content. Obviously there's no guarantee that this
header will actually be present.
The best solution would be to keep a local cache of the RSS feed and note
the date when any changes are made to it.
--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Navigation:
[Reply to this message]
|