CaRP Evolution Box
Web This Site

CaRP: Caching RSS Parser - Documentation

CaRP Interactive FAQ
Getting Started: Free Download | Purchase | Install
Reference: Functions | Plugins | Themes | Full Index
Etc.: Display Formatting | Example Code | Affiliates

CarpCache( url, cachefile );

Store a local copy of a newsfeed
Fetches an RSS newsfeed and stores it, unmodified, in a local cache file. The cache file is refreshed if it is older than the number of minutes specified in the cacheinterval configuration setting, or based on the value of cachetime. After this function completes, $carpconf['mtime'] will contain the UNIX timestamp for the last time the cache was updated.

  1. url: The address of the RSS newsfeed. May be a URL, path to a local file, or data from a Grouper cache specified as "grouper:cache-name". Note that Grouper must be loaded before calling CarpCache if using the "grouper:" syntax.
  2. cachefile: The filename of the local cache file.

Return value: 1 if it was necessary to refresh the cache, or 0 if the file in the cache was recent enough that it was not necessary.

Usage Example:
require_once '/home/geckotribe/carp/carp.php';
if (CarpCache('','gecko_tribe_press_releases.rss')) {