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

CarpCacheShow( url [, cachefile [, showit]] );

Store a local copy of a newsfeed, display it
EvolutionLEKoiSE
>=3.4All>=3.4>=3.4
Description:
This function combines CarpCache and CarpShow. It first caches the raw RSS feed and then displays it. The cache filename for the raw RSS feed is generated automatically. If you specify "cachefile", it will be used to cache the reformatted output. Since the raw RSS feed will be cached, it is less important to specify a cachefile than when calling CarpShow. We recommend using this function rather than CarpCache and CarpShow.

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 CarpCacheShow if using the "grouper:" syntax.
  2. cachefile: The filename of the cache file in which to store a reformatted copy of the newsfeed, based on your configuration settings. If this argument is omitted, no cache file is used. However, unlike CarpShow, a copy of the raw newsfeed is still cached locally so that it doesn't have to be refetched each time. Specifying a cache file simply prevents CaRP from having to format the feed each time it is displayed.
  3. showit: If you set this argument to 0, CarpCacheShow will behave identically to CarpCacheFilter. Note that you do not need to do this or use CarpCacheFilter to get filtering functionality.

Return value: (version 3.6.3 and greater only) 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';
CarpCacheShow('http://www.geckotribe.com/press/rss/pr.rss');
?>