CaRP Evolution Documentation
CaRP Evolution Documentation
twitter youtube linkedin google-plus
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
EvolutionLEKoiSE
AllAllAll>=2.7.1
Description:
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.

Arguments:
  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:
<?php
require_once '/home/geckotribe/carp/carp.php';
if (CarpCache('http://www.geckotribe.com/press/rss/pr.rss','gecko_tribe_press_releases.rss')) {
	CarpFilter(CarpCachePath().'/gecko_tribe_press_releases.rss','gt_press_releases');
}
CarpFilter('/home/geckotribe/public_html/feeds/myfeed.rss','myfeed');
CarpAggregate('gt_press_releases|myfeed');
?>