CaRP: Caching RSS Parser - Manual
     Version 2.7.5 (8/13/2003)

NOTE: This version of CaRP is obsolete. This documentation is being left here for those who have not yet upgraded to the current version.

Download | Installation | Configuration | Functions | Examples | Donations

Configuration
Configuration is done by changing the values in the array $carpconf. You may change the defaults by modifying carp.php itsself. You may override the defaults for a particular RSS feed by inserting lines like "CarpConf('cachepath','/my/private/cache/path');" after the line where you "require_once" CaRP, and before calling CarpShow().

The following options are defined in $carpconf, and are color-coded based on the likelihood that you'll want to change them, as follows: usually changed, often changed, sometimes changed, rarely changed

Cache Control | News Filtering | Channel Information Display | Item Display | Miscellaneous | Network Connection | XML Encoding

Cache Control:

  • cachepath: The path to the directory where your cached files will be stored--Important notes:
    1. If you wish to store the cache files in the same directory as the document being loaded by the web browser, set cachepath to '.', not ''. If you set it to '', CaRP will attempt to use your root directory to hold the cache files.
    2. To store the cache files in the same directory as CaRP, you must specify the path to that directory, not just '.', unless CaRP is located in the same directory as your web page that is using CaRP.
  • cacheinterval: The number of minutes before the cached file expires and the remote RSS feed is refetched
  • cacheerrorwait: The number of minutes to wait before refreshing the cache if an error occurs while attempting to fetch or parse it. Note that when using the cachetime setting below, this could result in the cache not being updated for an entire day.
  • cachetime: The time of day after which the cached file expires and the remote RSS feed is refetched. If this is blank (the default), cacheinterval is used instead. If this is set, cacheinterval is ignored. Specify the time as "H:M", where "H" is the hour in 24 hour format, and "M" is the minute. Be sure to specify the time in your server's time zone, which may be different from your time zone.
News Filtering:
  • filterin: Display only items which contain any of a specified set of words or phrases. When specifying more than one word or phrase, separate each with a "pipe" character (|). By default, CaRP checks both the title and description fields of each item for the indicated words. To check only one or the other, specify that word or phrase like "title:word" or "description:phrase to search for". Note that you must specify title or description for each word or phrase that you wish to only check one field for. For example, if filterin is set to "title:microsoft|apple", the title will be checked for "microsoft", and both the title and description will be checked for "apple". Note that you cannot search for pipe characters and colons.
  • filterout: Do not display items containing any of the indicated words. The format is the same as filterin. Note that you may use both filterin and filterout at the same time.
Channel Information Display:
  • showctitle: 1 to show the CHANNEL TITLE, 0 not to
  • showclink: 1 to display the CHANNEL TITLE as a hyperlink (using the CHANNEL LINK), 0 to display it as normal text
  • showcdesc: 1 to display the CHANNEL DESCRIPTION, 0 not to
  • maxctitle: The maximum length for the CHANNEL TITLE (it will be truncated and have "..." added to it if it is longer)
  • cclass: The CSS class for the CHANNEL TITLE (leave blank to not specify a class)
  • cstyle: The CSS style for the CHANNEL TITLE (leave blank to not specify a style)
  • cdiv: If you wish to enclose the CHANNEL TITLE/LINK in a DIV, enter the entire opening DIV tag here, including < and >--the closing tag will be added automatically if there is anything in this field
Item Display:
  • showdesc: 1 to show the DESCRIPTION fields for the ITEMs, 0 not to. If you set this to 1, you may wish to set $carpconf['postitem'] to '<p>' for nicer formatting.
  • maxdesc: The maximum number of characters to display from the description field, or 0 (the default) to display everything.
  • posttruncdesc: The text to display after any description that is truncated because it is longer than maxdesc. The default is <i>... continues</i>
  • maxitems: The maximum number of ITEMS to show--if the RSS feed contains more ITEMs, the rest will be discarded
  • maxtitle: The maximum length for the ITEM TITLEs (they will be truncated and have "..." added to them if they are longer)
  • linktitles: 1 (the default) to add a "title" element to the link, containing the entire ITEM TITLE, if it has been truncated because it was longer than maxtitle. The purpose of this is to display the entire title as a "tool tip" if it has been trucated. If set to 2, the title element will be inserted whether the TITLE is truncated or not. If set to 0, it will never be inserted.
  • defaulttitle: The text to display if a particular ITEM does not have a TITLE
  • preitem: Anything you enter here will be displayed before each news item
  • postitem: Anything you enter here will be displayed after each news item--the default is "<br>": a line break
  • preitems: Anything you enter here will be displayed once before the list of news items
  • postitems: Anything you enter here will be displayed once after the list of news items
  • linkclass: The CSS class for the ITEM LINKs (leave blank to not specify a class)
  • linkstyle: The CSS style for the ITEM LINKs (leave blank to not specify a style)
  • linkdiv: If you wish to enclose the ITEM TITLE/LINKs in a DIV, enter the entire opening DIV tag here, including < and >--the closing tag will be added automatically if there is anything in this field
Miscellaneous:
  • descriptiontags: A list of HTML tags, separated by pipes (|), which are allowed in the DESCRIPTION fields (both for the ITEMs and the CHANNEL)--all others will be handled as specified by removebadtags (see below).
  • removebadtags: 1 to completely remove any HTML tags not listed in descriptiontags (the default), or 0 to display them like "<tag>"
  • linktarget: 1 to open a new window when someone clicks a link, 2 to open in the same window, but ensure that it is not in a frame, 0 to follow the link in the current window (and frame, if in a frame set), or the name of the frame in which to open the link if in a frameset (NOTE: the name of the frame must contain at least one character that is not a digit).
  • outputformat: 0 to display CaRP's output as HTML (the default), 1 to output JavaScript which will display the output as HTML, or 2 to store the HTML formatted output in a PHP variable ($carpoutput), which your PHP code can use as desired.
  • poweredby: This is displayed at the end of each newsfeed. By default, it is a link to the CaRP homepage. If you remove this link, we would very much appreciate your posting a similar link somewhere on your website.
Network Connection:
  • basicauth: To access a newsfeed which requires a username and password and accepts "Basic" authorization, enter your credentials here as "username:password".
  • proxyauth: If you are using a proxy server which requires authorization and accepts "Basic" authorization, enter your credentials here as "username:password".
  • maxredir: The maximum number of redirects to follow before giving up (default 10).
  • timeout: The number of seconds to wait during the "CONNECT" phase of setting up a TCP/IP connection before aborting the attempt to load the RSS feed
  • sendhost: 1 to send the "Host" HTTP header, 0 to not send it--sending this almost never causes a problem, and is often necessary
XML Encoding:
  • encodingin: Specify the character encoding of the RSS feed. Valid values are ISO-8859-1 (the default), UTF-8 and US-ASCII.
  • encodingout: If you wish to have the output converted from the character encoding specified by "encodingin", specify which encoding you wish to convert to. Valid values are the same as for "encodingin".
Removed options:
The following options, which existed in $carpconf in earlier versions, have been removed and are now ignored:
  • truncdesc: Due to improvements in how CaRP truncates long descriptions, this setting is no longer needed. The number of characters of the description to display if it is over maxdesc characters long, or 0 (the default) to display maxdesc characters minus the length of posttruncdesc with any HTML tags removed.
  • newwindow: This setting has been replaced by "linktarget" to more accurately reflect what it now does.
News Headlines on ANY Website

Import RSS newsfeeds into ANY website! Pick your price:
$29.97: Use Jawfish, our RSS to JavaScript or frames conversion service (works with ALL websites)
Free: Download CaRP SE, our free RSS parser (requires PHP)
$47: Get the high-powered, plugin-extendable version, CaRP Evolution