CaRP: a caching RSS parser

CaRP: Caching RSS Parser - Revision History


For information about version 4.0.19 and later, see the CaRP section of the Gecko Tribe Blog.

6/22/2010: version 4.0.18
  1. Added 2 new settings: baggi and aaggi, which can be used to prepend and append content before and after items when aggregating. baggi is prepended before any channel data, and aaggi is appended after any channel data.
  2. Added the ability to use locale-aware date formatting using the cidateformat and iidateformat settings. If these are set, they are used to call strftime for format the channel and item dates respectively. (Otherwise cdateformat and idateformat are used with the date function).
  3. The Group Date and Hours Ago plugins were updated to support locale-aware date formatting.
  4. A new plugin was added: ItemIDs. It wraps each item in a <div> with a unique ID. This plugin is useful when integrating with other scripts that need to address individual feed items.
  5. Added example code showing how to integrate CaRP with PopCard.
6/8/2010: version 4.0.17
  1. Fixed a bug that sometimes prevented feeds from being fully loaded, resulting in XML parsing errors.
5/27/2010: version 4.0.16
  1. Adds mapping of audio in media:content elements to the internal "podcast" element.
  2. Ensures that "$carpversion" is a global variable, even if CaRP is loaded from within a script.
  3. Fixed a bug in the installer that prevented display of test feeds whose URL contained a question mark.
  4. Fixed a bug in the Processed Data and Sort plugins that caused them to malfunction if iorder, cborder or caorder contained extra spaces.
  5. Fixed a documentation error in the README.
4/12/2010: version 4.0.15
  1. CaRP now sends an "Accept" header to increase the probability that remote servers will send it data in Atom or RSS format.
  2. HTTPS feeds are now loaded using CaRP's code rather than PHP's fopen wrapper code. This enables CaRP to support password protected feeds via HTTPS, detect redirection loops and excessive redirection, send customized HTTP headers, etc.
  3. Fixed a bug in the Expander plugin that prevented open HTML tags from being closed if the description was truncated between opening and closing tags.
  4. Changes to the MySQL plugin:
    • The plugin now treats atom:id the same as an RSS guid.
    • Field mappings created for duplicate detection are now also used for data retrieval. They are set to a low priority to prevent conflicts with mappings set up by the user.
    • A bug was fixed in the code that deletes old items that had been marked for deletion.
1/10/2009: version 4.0.14
  1. After calling any of the display functions, $carpconf['items-shown'] is set to the number of items that were displayed.
  2. The Expander plugin now supports displaying the description in a hovering box.
  3. The Page plugin's CarpPageLinks function can automatically determine whether or not to display a "next" page link if called after the feed is displayed based on whether or not enough items were found for display on the current page. The one limitation is that if the last item on the current page was the last item in the feed, a link to one blank page will still be displayed.

Skipped version 4.0.13 -- I wouldn't want anyone to miss out on the new features because of superstitions!

12/27/2008: New Plugin
  1. Added an "Expander" plugin to enable dynamically expanding and collapsing descriptions.
12/26/2008: version 4.0.12
  1. Added a "Page" plugin to enable simple paging through long feeds.
  2. Fixed a bug that prevented plugins that filter items during aggregation from being able to stop processing of blocked items by other plugins.
  3. Added an optional parameter to CarpRegisterCallback to enable plugins to request that their callbacks be called before callbacks that don't need to be called earlier than others.
12/22/2008: Update to Processed Data Plugin
  1. Fixed a bug that prevented channel data from getting stored properly.
  2. Fixed a bug that prevented character set transcoding from being handled properly in some cases.
11/28/2008: version 4.0.11
  1. Fixed a potential security issue -- on servers where PHP's register_globals option is turned on (it's been off by default since the release of PHP 4.2.0 back in 2002), an attacker could cause functions that don't require any arguments to be executed when CaRP loads.
  2. Fixed a bug that prevented the same theme from being loaded twice on the same page.
11/7/2008: version 4.0.10
  1. The Podcast plugin was updated to add support for Carp(Cache)Filter, CarpAggregate and CarpInterleave.
  2. CaRP Evolution was updated to work with the changes to the Podcast plugin.
  3. CaRP LE is unchanged.
10/1/2008: version 4.0.9
  1. Fixed a bug that caused an error message to be displayed when using the Processed Data plugin (or the Sort plugin, which itself uses the Processed Data plugin), manually caching the output, and using an output encoding not supported by PHP's XML parser.
  2. Fixed a bug that prevented sorted output from being transcoded to the desired output encoding when using the Processed Data plugin (or the Sort plugin, which itself uses the Processed Data plugin).
  3. Fixed a bug that prevented error messages from being displayed when using the Processed Data plugin with "allow_display" set to 0.
  4. Created two new functions that plugins or code that uses the Processed Data plugin can use to transcode their output.
  5. Updated the Processed Data plugin to enable it either to transcode its output or not when CaRP's output encoding is not supported by PHP's XML parser. If the plugin does not transcode the output, the code that calls the plugin can transcode it more efficiently all at once before display.
  1. Replaced CaRP SE with CaRP LE, which does not display descriptions, but does display dates and authors.
  1. Added a new podcast plugin.
9/23/2008: version 4.0.8
  1. Added a plugin to enable sorting items in a user-specified order or shuffling the order randomly.
  2. Fixed a trivial bug in the sorting code used with CarpAggregate (which may never have had any effect at all).
8/29/2008: version 4.0.7
  1. Added two new configuration settings, "afield" and "aitem", to control what, if anything, is to be output immediately after each "field" (the things listed in iorder, cborder and caorder), as well as after each item. By default, a "newline" character is output in each of these places (as in previous versions of CaRP). In a webpage, the newline character is displayed as a space instead of a line break. The "aitem" setting should only be modified if you wish to omit the newline character -- for all other purposes, use the "ai" setting instead.
  2. Some unused code was removed from CaRP SE.
  3. A bug was fixed in CaRP Evolution which caused the URLs of images containing ampersands (&) to become corrupted.
  4. CaRP Evolution's MySQL plugin was updated in several ways:
    • When used with CarpCacheShow, it now stores the feed URL in the "real_url" field instead of the address of the cache file.
    • The timestamp from when the feed was last polled is now stored in the rssfeeds table.
    • Individual feed items can be marked for deletion (using your own custom code and two new functions that were added to the plugin). When the feed is refreshed, any items marked for deletion which no longer appear in the feed can be purged from the database. (They should not be deleted until they no longer appear in the feed, or they will be reinserted into the database the next time the feed is polled).
8/11/2008: version 4.0.6
  1. CaRP Evolution only: fixed a bug that prevented plugins using the "handlefield" phase from working (oops!)
8/11/2008: version 4.0.5
  1. Added a "cachemiss" callback phase to CaRP Evolution which can be used to avoid executing unnecessary configuration code when CaRP is pulling formatted data from its manual cache.
  2. Added a "Processed Data" plugin to return parsed data in a PHP variable (similar to RSS parsing libraries like Magpie which parse, but don't display, feeds).
  3. Added support for the mb_convert_encoding for servers that don't support iconv for character encoding conversions (CaRP Evolution only).
  4. Fixed a bug in the MySQL plugin which caused it to require a database connection to be explicitly set up.
  5. Various performance optimizations.
  6. Enabled plugins to prevent full processing from the startprocessing phase, and added notification to plugins called at the startprocessing and endprocessing phases to tell them whether some plugin prevented full processing.
  7. Updated plugins to support the change in startprocessing and endprocessing.
7/2/2008: version 4.0.4
  1. Fixed a bug introduced in version 4.0.3 that caused warning messages to be display in some cases, and prevented the NumericEntities plugin from converting output to encodings other than UTF-8.
  2. Updated the QuickTime plugin so that it can handle videos pointed to by Media RSS elements.
  3. Added a new Click plugin which can route clicks to the channel and item title links through any URL you wish. It could be used, for example, to track how many times each headline was clicked. (You should always finish by redirecting to the original link target).
6/24/2008: version 4.0.3
  1. Fixed the "fixentities" setting so that it handles numeric entities properly.
  2. Added a new NumericEntities plugin that converts numeric entities (like &#1234; or &#x3A2C;) to regular characters. This is useful when converting feeds to email or other formats where numeric entities aren't always handled properly.
  3. Added a new QuickTime plugin that displays QuickTime, MPEG and MPEG-4 videos.
  4. Added a hook for plugins for the "output" phase.
5/14/2008: version 4.0.2
  1. The Hours Ago plugin now respects the "timeoffset" setting.
  2. When using the XMLEncode plugin, HTML tag removal wasn't working, and truncation of the description was counting the lengths of HTML tags. Both problems have been fixed.
  3. The YouTube plugin now sets the "classid" attribute on the object tag, which is necessary for some browsers to display the videos properly.
  4. Note: CaRP SE 4.0.2 was not released because none of the changes affected it.
4/9/2008: version 4.0.1
  1. Fixed a bug that caused the contents of the ilink_attrs and clink_attrs settings to be displayed when iorder contained "title" instead of "link".
  2. The timeoffset setting now affects the sort order when using it with CarpAggregate.
  3. Apparently under some circumstances, carriage return characters in a feed caused problems with CarpAggregate and CarpInterleave (I wasn't able to reproduce the problem -- I think it's related to PHP version 5, which I'm not yet using). CaRP now replaces those characters with spaces to ensure that they don't cause problems.
  4. Fixed a bug that sometimes caused too many cache files to be refreshed at a time when using CarpGroupFilter.
  5. Added the ability to call CarpGroupFilter without specifying cache file names for the feeds. Instead, simply list the feeds to be processed, and add a group name as a second argument to CarpGroupFilter.
  6. The YouTube plugin now checks for "" in the URL of the video so that it can be used with composite feeds containing YouTube and other Flash content.
  7. The YouTube plugin has a new function, YouTubeScale, that can be used to easily set the dimensions of the video.
  8. Fixed a bug in the RSS 2.0 theme which caused it to use the element name "date" instead of "pubdate" in the channel section when using the RSS20Aggregate function.
Between versions 4.0 and 4.0.1
  1. Added a YouTube plugin to CaRP Evolution.
3/4/2008: version 4.0
  1. Initial rollout of CaRP 4.0 to previous buyers began on March 4, 2008. Availability to new purchasers began March 11.
  2. Added a new function, CarpInterleave, which works like CarpAggregate except that items are taken from the feeds in round robin order rather than sorting them together by timestamp.
  3. Added "clink_attrs" and "ilink_attrs" to enable easy adding of arbitrary attributes to the channel and item link tags.
  4. Moved control of which tags are always removed from the description (regardless of the "descriptiontags" setting) from a hard-coded place in carpinc.php to a constant that is set in carpconf.php.
  5. Updated the installer to make it possible to use on servers that aren't connected to the internet.
  6. Removed backwards compatibility with the following configuration settings (use the setting listed in parenthesis instead): corder (cborder), bc (bcb), ac (acb), clinktarget and ilinktarget (linktarget).
  7. Stopped distributing CaRP Free -- replaced it with an essentially identical version named CaRP SE (which is also available at no charge).
  8. Stopped distributing CaRP Koi (except to a very limited number of people). CaRP Koi users can upgrade to CaRP Evolution 4.0 at a discounted price.
CaRP Evolution (and Koi where noted) only:
  1. Enabled to process Atom 0.3 and Atom 1.0 feeds internally without the use of Grouper Evolution (Koi also).
  2. Added a "strip-xhtml-prefixes" option to control whether namespace prefixes are removed from XHTML content in Atom feeds (Koi also).
  3. Added support for xml:base processing in Atom feeds (Koi also).
  4. Added the XML Encode plugin, which prepares all feed data for output within an XML document.
  5. Added an RSS 2.0 theme which works with the XML Encode plugin to generate an RSS 2.0 feed from the input data. This theme and plugin enable CaRP Evolution to generate "mashup" feeds -- a process which used to require CaRP, Grouper Evolution and Moray, all working together.
  6. Added a Group Date plugin, which groups feed items by date, displays a date header for each group, etc.
  7. Updated the Flex Format plugin to be able to repeat the same settings at specified intervals to, for example, alternate between different background colors for each item.
  8. Added an "alternating" theme that works with the updated Flex Format plugin.
  9. Updated the Replace Text plugin so to it can operate either before or after CaRP applies formatting settings to each piece of data. This also enables CaRP to apply Replace Text settings before the MySQL plugin stores the data.
  10. Updated the MySQL plugin to:
    • enable setting static values for some fields.
    • check for pre-existing database connections better.
    • Store the actual URL of each feed in the rssfeeds table.
    • Enable storage of the URL of a podcast file.
  11. Updated so that plugins are reinitialized if they are reloaded.
  12. Added a new processing phase, "getfieldvalue", that plugins can hook into.
  13. Standardized all internal field names to lowercase (which is usually transparent to the user, but if you're writing plugins or hacking around, it may make a difference) (Koi also).
6/25/2007: version 3.6.4
  1. CaRP Koi is no longer available as a purchase option. It will continue to be updated and supported for those who have purchased it in the past.
  2. CaRP is only distributed in a ZIP archive (not in a Tar/GZip or StuffIt archive as in the past). Copies of carpconf.php with Mac and UNIX style linebreaks are provided along with a Perl script that can be used to convert linebreaks in other files if desired.
  3. When using mySQL caching, if another script on the page has connected to mySQL and selected the appropriate database, it is no longer necessary to tell CaRP the name of the database
CaRP Koi and CaRP Evolution only:
  1. CaRP will use the GUID element as the item link if no link element is found and the GUID element's isPermaLink attribute's value is "true" or there is no isPermaLink attribute.
CaRP Evolution only -- the following changes have been made to the Hours Ago plugin:
  1. A "showfuturedates" option has been added. If an item has a datestamp that is in the future and this option is set to "0" (zero), the datestamp will not be displayed (this is to avoid things like "Posted -15 minutes ago").
  2. If no datestamp is to be displayed, the before and after settings for the date will not be displayed.
  3. If the "dodays" option is set to a negative number, that number specifies how old an item may be and have it's datestamp displayed using the plugin's format. Older dates are displayed using CaRP's built-in date formatting.
10/20/2006: version 3.6.3
  1. When mySQL-based caching is selected, the installation script now creates tables capable of holding 16MB feeds. Earlier version created tables capable of holding only 64KB feed, resulting in erronous XML parsing errors being reported.
  2. The function CarpGroupFilter now generates and returns a list of cache file names which can be passed to CarpAggregate, so that you don't have to generate the list yourself.
  3. The function CarpCacheShow now returns the same value as CarpCache--ie. 1 if the cache was refreshed, or 0 if the existing cache data was used.
CaRP Koi and CaRP Evolution only:
  1. Before attempting to use the "iconv" function to convert a feed's encoding (a.k.a. charset), CaRP now verifies that iconv support is available on the server. If it isn't, CaRP attempts to process the feed as UTF-8, and reports an error if that attempt fails.
CaRP Evolution only:
  1. The Newer Than plugin was updated to enable it to work with feeds that aren't sorted in the usual most-recent-first order. (For performance reasons, the default settings still require feeds to be sorted most-recent-first, but one line of code will enable it to work regardless of sort order).
  2. The mySQL plugin was updated to ensure that it doesn't open multiple mySQL connections when displaying multiple feeds on the same page.
  3. The setup script for the mySQL plugin was updated to enable it to work properly on some mySQL versions that it had trouble on before.
  4. The Replace Text plugin was updated so that when using "regular expressions", it is no longer necessary to precede slashes (ie. "/") with two backslashes (e.g. "\\/"). NOTE: Existing code containing "\\/" must be updated to work with the new version of the plugin.
5/19/2006: version 3.6.2
  1. Added the ability to process feeds that use unusual namespace prefixes. For example, while nearly all feeds do not use a namespace prefix for RSS core elements, uses the prefix "rss" (eg., it uses "rss:link" instead of "link", "rss:title" instead of "title", etc.). To enable CaRP to process such feeds, use the function CarpMapPrefix.
  2. CaRP now displays a more informative error message when given a URL that points to something other than an RSS feed (eg. and HTML webpage, an Atom feed, etc.).
  3. The README file contains new sections about how to get started displaying feeds, using CaRP with Grouper, the parts of an RSS feed and CaRP's names for them, and overview of CaRP's configuration system, etc.
  4. The setup script now works with PHP versions below 4.1.
  5. The setup script can now run successfully on servers that do not allow scripts to open TCP/IP connections to the same server on which they are hosted.
  6. The setup script now outputs the necessary mySQL caching setup code for installations where the database name begins with a digit or contains a hyphen.
4/11/2006: version 3.6.1
  1. Fixes a bug that prevented cache data from being saved in some circumstances where your code calls CarpCache directly.
  2. Enables caching in mySQL databases whose names start with a digit by adding the option "mysql-select-db". If your database name starts with a digit and you wish to use mySQL caching, use must set this option to "1" using this code:
    I recommend putting this code, along with all the other code that configures CaRP for mySQL caching, into carpconf.php as noted by the installation script.
  3. Adds a new plugin named AgeFormat, which is similar to the FlexFormat plugin, but which alters CaRP's output formatting based on the timestamp in each item. This plugin works only with feeds that have timestamps for each item.
  4. Adds support for "Media RSS" elements that point to images. If your "iorder" configuration setting includes "image" and the feed uses Media RSS elements (but not enclosure or image elements pointing to images), CaRP will display the images pointed to by the Media RSS elements. If you wish to give higher priority to Media RSS elements over enclosures and image elements, you must use the CarpMapField function.
  5. Pre-configures CaRP to use the content:encoded element when it appears in items that don't have description elements. If you wish to give higher priority to the content:encoded element, you must use CarpMapField.
  6. The installation script outputs an error message if PHP is not active on your server. Previous versions of the installer script obviously didn't work in such cases, but did not clearly indicate the cause of the problem.
  7. The installation script automatically fixes the path to the carp folder on some servers where the path must begin with "//" (eg. some if not all Yahoo! web hosting accounts).
2/23/2006: version 3.6
  1. Integrated the code from transcode.php into CaRP Koi and CaRP Evolution, enabling automatic detection and processing of feeds using encodings other than those supported by PHP's built-in XML parser.
  2. Also added support for automatic transcoding of output to enable display on webpages using encodings other than those supported by PHP's built-in XML parser.
  3. NOTE: iconv support on the server is required for both of the above.
  4. Changed the behavior of the "encodingin" setting. In the past, if the feed specified an encoding, it overrode any "encodingin" setting. Now, the default value of "encodingin" is blank, and if it is specified, it overrides the encoding claimed by the feed.
  5. Updated the "ul" theme with the latest changes.
  6. Added two podcast themes: podcast-lite and podcast-heavy.
  7. Added some icons to use in conjunction with podcast feeds.
  8. Changed the license for the free version of CaRP from the GPL to a license of our own. Also changed the name from "CaRP GPL" to "CaRP Free" to reflect the change. In summary, CaRP Free is free for use and modification for your own use, but in most cases can only be redistributed unmodified in its original archives.
  9. Reversed the order of operations when restoring the previous state of PHP error reporting to reduce the probability of warning messages being displayed on some systems.
2/16/2006: version 3.5.11
  1. Added podcast support.
  2. Added support for conditionally mapping elements based on things like vales of their attributes.
  3. Added support for "themes"--reusable configuration presets--and bundled an unordered list theme.
  4. Added the ability to have CaRP errors link to documentation descibing their causes and solutions.
  5. Fixed a bug where the "timeoffset" configuration value was applied even if the date could not be parsed, resulting in a non-zero timestamp when the time was unknown, and thus should have been zero.
2/9/2006: version 3.5.10
  1. Fixed the truncation code (for titles and descriptions) to make it count multi-byte characters and HTML entities as single characters, and to prevent either of the above from being split at the end of the data.
  2. Added the ability to have CaRP request cache data from Grouper by specifying "grouper:cache-name" as the URL of a feed. This is to enable CaRP to work with Grouper installations that use mySQL-based caching.
  3. CaRP now deletes everything from the start of a feed to the first "<" symbol to avoid XML parsing errors in feeds which erroneously contain blank lines or whitespace at the beginning of the document.
  4. Fixed CarpGetCache to always return cache contents as a string. Previously, they were returned in an array of strings if the cache contents were coming from a file, and as a string if coming from a mySQL database.
  5. Updated the installation script to generate 64 character index columns in cache databases rather than 32 character (except for the auto-cache table, which remains at 32 characters).
  6. Added documentation and forum search forms to the README file. Documentation search may not yet search all of the documentation since it is Google-powered, and Google hasn't yet completely indexed the new location to which we recently moved the documentation.
  7. CaRP Evolution only: Updated the ReplaceText plugin to make regular expressio matches match the "." metacharacter to line ending characters, enabling a wider variety of multi-line matches.
  8. CaRP Evolution only: Updated mysql_setup.php to make the table creation code compatible with more versions of mySQL (those that require default values to be enclosed in quote marks).
1/12/2006: version 3.5.9
  1. Fixed a bug in the aggregation code which occurred when using mySQL-based caching.
1/11/2006: version 3.5.8
  1. Added the option of caching in a mySQL database instead of in flat files.
  2. Updated the installer script to offer the choice of setting up cache directories or mySQL cache tables.
  3. Fixed a bug that caused an error message to be displayed if two processes tried to update the same cache file at almost the same instant.
  1. Added the "Hours Ago" plugin to CaRP Evolution, enabling display of datestamps in formats like "x minute ago", "x hours ago", and "x days ago".
10/14/2005: version 3.5.7
  1. Added the ability to delete only inactive files using the CarpClearCache function.
  2. Added encoding detection to the free version.
  3. Bundled a transcoder script with CaRP Koi and CaRP Evolution to convert feeds encoded in character sets other than UTF-8, ISO-8859-1 and US-ASCII so that PHP's XML parser will be able to process them. This addition will enable support for any feed in a character set supported by iconv.
7/9/2005: version 3.5.6
  1. A new function was added: CarpGroupFilter. It does the same thing as CarpCacheFilter, except that it processes multiple feeds at once, and you can specify the maximum number of feeds to refresh at once to increase the perceived speed of your website. In the past, aggregating many feeds required setting up a cron job to keep them up-to-date without periodically causing a slow page load for one website visitor when the feeds were refreshed. Using this function, you can guarantee that each site visitor only has to wait for a few of the feeds to be updated, which usually happens fast enough that it isn't noticable.
  2. Added a new option, maxgroupfilter, to specify that maximum number of feeds that will be re-fetched from their source during a single call to CarpGroupFilter.
  3. The default for the "fixentities" option was changed from 1 to 0. Therefore, by default, CaRP no longer attempts to fix certain types of broken RSS feeds. The reason for this change is that this setting could cause incorrect display of some valid feeds, and valid feeds are becoming more common than they used to be.
  4. The default for the "encodingin" option was changed from nothing to "UTF-8". With the old empty setting, the default was effectively "ISO-8859-1". In CaRP Koi and CaRP Evolution, if the feed specifies its encoding in the XML prologue, which many if not most do, that value overrides this setting. In CaRP GPL, or for feeds that don't specify the encoding, use the "encodingin" configuration setting to specify the encoding if it is not UTF-8.
  5. Updated the NewerThan plugin so that it works with CarpAggregate. A plugin API callback phase was added to enable this.
  6. The mySQL plugin was updated to fix a bug in the duplicate detection code.
  7. Handling of HTML tag stripping was updated to fix a bug that occurred when attempting to remove all HTML tags.
2/23/2005: version 3.5.5
  1. Added the ability to offset the timestamps by any number of minutes.
  2. Added an option to not fix invalid XML entities. This is useful when displaying feeds whose content is enclosed in CDATA sections. The old code erroneously re-escaped any entities found in these sections.
  3. The values of "atruncidesc" and "atrunccdesc" are now appended to truncated data before any open HTML tags are closed. This is mainly to prevent the text from being appended after closing paragraph tags (</p>).
  4. Ampersands (&) are now entity encoded when they appear in URLs in link or image elements.
  5. Improved the code for turning display of PHP errors on.
  6. Formatting of channel data is done later so that channel images can be displayed in RSS 1.X feeds where the image element is not a child of the channel element.
  7. Updated the installation assistant to use either FTP or Telnet to set access permissions, rather than only supporting use of Telnet.
  8. Improved the instructions for setting access permissions manually.
  9. If the cache folders already exist and have their access permissions set properly, the setup assistant now skips the step where it creates them.
10/7/2004: version 3.5.4
  1. A new installation assistant automates the process of setting directory access permissions.
  2. Changed so that by default, no PHP errors or warnings are displayed.
  3. Changed the default text that is appended to truncated descriptions from "...continues" to "...".
9/28/2004: version 3.5.3
  1. Updated the default configuration to output XHTML compatible <br /> tags.
  2. Added code to handle entity encoded line breaks properly when outputting as JavaScript.
  3. Fix a bug that caused HTML stripping to malfunction when configured so that no HTML is allowed.
  4. Added code to strip NULL characters, which were causing XML parsing errors in some feeds.
  5. When auto-detecting character encoding, CaRP now checks for both single and double quote delimiters.
  6. Fixed a bug which caused numerical entities to be double-escaped, resulting in incorrect display.
  7. Made a few minor improvements to the setup assistant scripts.
3/10/2004: version 3.5.2
  1. Fixed a bug that prevented newsfeeds from being displayed properly from cache files.
  2. Fixed an issue that prevented newsfeeds from being loaded from some web servers.
3/9/2004: version 3.5.1
  1. Fixed a bug in proxy server code.
  2. Fixed a bug that could cause a cache file or error message to be displayed if a connection failed when calling CarpFilter (nothing should be displayed when calling CarpFilter).
  3. Fixed an oversight that caused configuration variables to become undefined if a null value was passed to CarpConf.
  4. CaRP now decodes entity encoded apostrophies (&apos;), because some browsers (including Internet Explorer) do not recognize it as a valid entity.
1/12/2004: version 3.5
  1. Added the ability to parse ISO 8601 format dates using the "Z" time zone designator.
  2. Created a setup assistant to help with creating the cache folders as securely as possible, to assist in specifying paths correctly, and to assist with specifying proxy server settings correctly.
  3. Modified and rearranged the caching folders for better organization and security. When upgrading, you must switch to the new directory structure. We recommend using the setup assistant to help with this process.
  4. Added the ability to replace the functions that set the paths to the cache files, in case you do not want to use the standard directory structure.
  5. Changed the default configuration to turn off PHP warnings and notices (errors are enabled by default).
  6. Added functions to delete single cache files or clear entire cache directories.
  7. Fixed an oversight that required field names in calls to GetFieldValue to be specified in uppercase. (Koi and Evolution only)
  8. Added a plugin for performing more powerful filtering (and, or, regular expressions, etc.) (Evolution only)
  9. Added a plugin for storing parsed newsfeed contents in a mySQL database, including a setup script to create the database tables. (Evolution only)
12/15/2003: version 3.4.1
  1. Fixed an issue that caused warnings to be displayed on some systems when running CaRP Evolution.
  2. Changed the internal name of the field containing the link URL from "LINK" to "URL", to be more consistent with other parts of the program. If using the function CarpMapField('LINK',..., you must change it to CarpMapField('URL',... when upgrading. Evolution plugin developers using the function GetFieldValue('LINK'); must change it to GetFieldValue('URL');
  3. Made a few changes to the CaRP Evolution plugin API for the displaychannel and displayitem phases. See the CaRP Evolution plugin API documentation for details.
  4. Added a plugin for CaRP Evolution to enable varying the visual formatting of the newsfeed from item to item.
12/8/2003: version 3.4
  1. Added functions to combine CarpCache with CarpShow or CarpFilter (CarpCacheShow and CarpCacheFilter). The new functions call CarpCache to cache the raw newsfeed in an automatically named file, and then either display or filter it. Using this function will ensure that you are not needlessly loading the same newsfeed for display on multiple web pages without requiring you to make sure you use the same cache file name on each.
  2. Added the ability to display channel information either before or after the list of news items, or both.
  3. Added the ability to display the channel information associated with each news item when aggregating from multiple feeds using CarpFilter. If you are using CarpFilter and do not wish to display channel information, you must call CarpConf('cborder','');
  4. Changed the internal field names used with CarpMapField for the description and date fields from "DESCRIPTION" to "DESC" and "PUBDATE" to "DATE" respectively for greater consistency with other naming conventions used by CaRP (Koi & Evolution only).
  5. When determining a timestamp for newsfeeds which do not indicate timestamps for individual items, CaRP now choose a timestamp for each that will keep them in order when calling CarpFilter and CarpAggregate.
  6. Added the function CarpUnregisterCallback to un-register plugin callback functions when displaying one feed using a plugin followed by another not using the plugin (Evolution only).
  7. Updated the AccessKeys plugin for CaRP Evolution to unregister its callbacks when it is reset.
  8. Added a new plugin for CaRP Evolution named "Replace Text". This plugin can be used to modify the contents of a newsfeed based on string or regular expression matching. Expand acronyms, add bold or italics to certain words or phrases, "bleep" language you don't want appearing on your site, etc. (Be aware that modifying the contents of a newsfeed may be a violation of copyrights or have other legal consequences.)
Officially fixed the names of the three CaRP versions as: 11/11/2003: version 3.3
  1. Added a configuration option to specify a proxy server address. IMPORTANT NOTE: If you use a proxy server, you will have to switch to the new method of specifying the proxy server. The old method is no longer supported.
  2. Added the ability put configuration overrides into a separate file (carpconf.php) and have it automatically loaded, removing the need to modify new versions of carp.php when upgrading.
  3. carpconf.php may also be used to create any number of configuration sets, making it easier to standardize newsfeed formatting across your website.
  4. Added the ability to display the link URL (i.e., actually display the URL rather than using it to make the title into a link).
  5. Added the ability to display the channel date (Koi & Evolution only).
  6. CaRP now attempts to determine a reasonable timestamp for items with no date indicated when calling CarpFilter, making the order of items output by CarpAggregate more accurate.
  7. Beginning with version 3.3, we have created a new version, CaRP Evolution, which can be extended by plugins, both from us and third parties. We have periodically received requests for features which do not fit well into the scope of what CaRP is designed to do, and would simply bloat the program for the many users who do not need those features. Going forward, we will be able to accomodate more feature requests by creating plugins. Version 3.3 includes one plugin, which adds "access keys" to item links. Access keys allow the links to be selected or activated using the keyboard by typing alt-access key (Windows) or control-access key (Macintosh). Most modern web browsers support access keys.
11/6/2003: version 3.2
  1. Fixed a bug that caused a "</span>" tag to be output at the end of titles even if no CSS class or style was specified.
  2. Added the ability to decode the full date/time format for the "DC:DATE" field. (NOTE: the date is only displayed by the commercial version of CaRP, but is used by either version to sort items when aggregating.)
  3. Added the ability to display item titles as plain text instead of as hyperlinks (as could already be done for the channel title).
  4. Fixed a situation that caused a notice to be displayed if the PHP error reporting setting included display of notices and filtering was being performed on both the title and description.
The following additional changes were made to the commercial version only:
  1. Added the ability to change the mapping of RSS fields to CaRP's display fields, making it possible to correctly display many incorrectly formatted newsfeeds, and providing greater compatibility with current and future extensions to RSS.
  2. Fixed a bug that caused some characters in image alt tags to be incorrectly entity-encoded.
  3. Fixed a design limitation that could have produced unpredictable image output if multiple images were specified for a single item.
10/30/2003: version 3.1.5
  1. Added the function CarpCachePath, which returns the path to the cache directory, which is $carpconf['cachepath'], prepended by the path to carp.php if $carpconf['cacherelative'] is not "0". This function is useful for displaying cached raw RSS feeds. For example, you might use the following commands:
  2. Added the function CarpConfAdd, which can either prepend or append additional text to an existing configuration variable. For example, to add the <u> and </u> tags to the list of HTML tags allowed in the description field, you could use the command CarpConfAdd('descriptiontags','|u|/u');
  3. Added the function CarpConfRemove, which removes text from an existing configuration variable. For example, to remove the <b> and </b> tags from the list of HTML tags allowed in the description field, you could use the command CarpConfRemove('descriptiontags','b|/b');
  4. Made a few minor performance enhancements.
10/27/2003: version 3.1.4
  1. Added ability to turn CaRP's error reporting off.
  2. Added the ability to set PHP's error reporting level. The original error reporting level is restored when CaRP exits.
  3. XML documents encoded in character sets not supported by PHP's XML parser no longer set their encoding automatically (full version only). Doing so would have produced unpredicatable results.
  4. Fixed a number of issues that caused warning notices to be displayed on some systems, but which did not affect functionality in any way.
10/20/2003: version 3.1.3
  1. Added support for displaying images specified by the RSS 2.0 "enclosure" tag (commercial version only).
  2. Added the ability to show a user-specified message if no news items are found (usually due to use of the "filterin" and/or "filterout" settings).
  3. Fixed display of entity encoded characters in channel and item titles.
  4. HTML in channel and item titles is now completely removed rather than being displayed as raw HTML.
10/16/2003: version 3.1.2
  1. Changed the default behavior of CaRP so that it looks for its cache files in a subdirectory of the location where CaRP itsself is located rather than an absolute file path.
  2. Fixed a bug that could cause one newsfeed to be displayed twice on a page that first displays and caches a newsfeed and later dislays a newsfeed without caching it if the second feed failed to load.
  3. Fixed a bug that could result in a misleading error message if a newsfeed could not be opened and there was no cached version of it available for display.
  4. Fixed a bug that could cause extra HTML tags to be considered when making sure that paired tags are properly closed when truncating long descriptions. This bug would not actually cause any problems, but was fixed because it was technically incorrect.
  5. Made the capitalization of "Carp" or "CaRP" more consistent in style throughout the script.
10/9/2003: version 3.1.1
  1. Added the ability to save cache files in a path relative to the location of CaRP itsself. Older versions required an absolute path or a path relative to the location of the PHP page being loaded by the web browser.
  2. Combined the $carpconf['clinktarget'] and $carpconf['ilinktarget'] settings into one ($carpconf['linktarget']), since it seems highly unlikely that they will ever be different. This will make overriding the defaults easier since only one setting will need to be changed. The old settings are still supported for backward compatibility, but ilinktarget will override clinktarget if it is set.
  3. The link target for image links is now controlled by the linktarget setting.
  4. $carpconf['bc'] and $carpconf['ac'] are no longer displayed if the requested channel fields are all empty.
  5. Fixed a bug which caused the "alt" text for images to appear in the associated link ("a") tag rather than in the "img" tag.
10/4/2003: version 3.1
  1. Fixed a bug that caused $carpconf['bc'] and $carpconf['ac'] to be displayed even if no channel fields is being displayed.
  2. Fixed a bug that caused extra line breaks to be added to the ends of some fields.
  3. The files created by CarpFilter (and used by CarpAggregate) are not compatible with earlier versions, and should be deleted when upgrading.
The following additional changes were made to the commercial version only:
  1. Added the option to skip duplicate stories based on whether the headline is identical. This is especially useful when using CarpAggregate, or when displaying newsfeeds that are aggregates of multiple news sources.
  2. Added the ability to display both channel and item images. Maximum, fixed and default image dimensions may be specified.
9/30/2003: version 3.0.2
  1. After calling CarpCache or CarpShow (with a cache file specified), $carpconf['mtime'] contains the UNIX timestamp for the last time the cache file was modified. Programmers of complex systems based on CaRP may find this information useful in avoiding unnecessary processing of files.
9/25/2003: version 3.0.1
  1. Fixed a bug in JavaScript output that caused script errors when reading a JavaScript formatted file from cache.
  2. Fixed a bug in title display that caused HTML tags in the text that was appended when the title was truncated to be displayed incorrectly.
  3. Removed two legacy functions, ShowRSSPage and ShowRSSFeed, both of which were old names for CarpShow.
9/19/2003: version 3.0
  1. Split CaRP into 2 versions: a freely available version (GPL) and a commercial version ("full version") with a few extra features. The full version is available for a nominal fee--essentially a donation to support the development of CaRP.
  2. Completely overhauled the system for specifying how to display newsfeeds to make it more flexible, logical and extendable in the future. NOTE: Due to the extent of the changes that were made, CaRP 3.0 is not backward compatible with many configuration settings from previous version. See the upgrade guide in the manual for details of how to convert smoothly from a previous version.
  3. Security enhancement: Removes JavaScript handlers from any HTML tags that are not removed (onMouseOver, etc.)
  4. Security enhancement: Does not allow certain HTML tags, even if they are listed in the "descriptiontags" setting. Disallowed tags are script, embed, object, applet, and iframe.
  5. CarpCache now has a return value indicating whether or not it was necessary to update the cache file. If you have a script that processes the cache file after it is updated, your script may skip this processing if the cache was not updated.
  6. Automatically sets the encoding of the incoming newsfeed if the newsfeed specifies it explicitly (full version only).
  7. Displays the author/creator and date/time fields. (full version only).
8/13/2003: version 2.7.5
  1. Fixed a bug that caused attempts to override "cachepath" using the CarpConf() function to fail.
  2. To avoid the possibility of having two processes update the same cache file at the same time, CaRP now attempts to lock the cache file before updating it.
  3. Changed the name of the "newwindow" configuration option to "linktarget" to better reflect the additional functions it now controls. "newwindow" is still supported for backward compatibility.
8/2/2003: version 2.7.4
  1. You now have three options for how to handle CaRP's output: as JavaScript (so that the news can be displayed in non-PHP pages), storing it in a PHP variable (so that your code can do whatever it wants with it), or simply displaying it as it does now.
  2. When CaRP is run in a frameset, you can now have the link targets set to any frame.
7/21/2003: version 2.7.3
  1. Fixed a bug in the handling of the "newwindow" setting.
7/19/2003: version 2.7.2
  1. Added support for newsfeeds requiring basic authentication (username and password) to access.
6/30/2003: version 2.7.1
  1. Added the ability to cache a complete newsfeed without performing any processing on it, which is useful to increase performance when creating multiple sets of aggregated news stories on different topics from a set of newsfeeds.
6/17/2003: version 2.7.0
  1. Added the ability to break out of a frameset when opening a story in the existing window.
  2. Added the following functions to facilitate better aggregating of news from multiple sources:
    • CarpFilter: Filters news stories from a single newsfeed and stores them in a cache file. Note that the format of cache files created by CarpFilter is different from the format created by CarpShow (formerly ShowRSSFeed). Nothing is displayed when calling this function.
    • CarpAggregate: Displays the most recent stories from any number of cache files created by CarpFilter.
  3. Renamed "ShowRSSFeed" to "CarpShow" to make it more consistent with "CarpFilter" and "CarpAggregate". The function name "ShowRSSFeed" is still supported for backwards compatibility, but may be removed in the future.
  4. Added the ability to filter for text which contains colons if you are specifying a field to filter. (It is still not possible to look for colons if you do not specify a field).
  5. Added a new function, CarpConf, to set values in the $carpconf array. This method will help to ensure that the names of the options are spelled correctly, because it displays an error if the option is unknown.
6/11/2003: version 2.6.0
  1. Added the ability to filter news stories by keywords, including and/or excluding stories based on whether specified words appear in the title and/or description fields.
  2. If an RSS feed fails to load or parse properly, CaRP no longer deletes the contents of the cache file. Instead, it marks the cache to be refreshed again after a configurable number of minutes.
  3. Added the function CarpConfReset to allow the user to quickly reset all the values in $carpconf to their default values.
  4. Split the script into two parts to reduce overhead when reading a newsfeed from cache.
  5. Changed the script filename from rssparser.php to carp.php.
6/9/2003: version 2.5.2
  1. Added support for proxy servers requiring authentication.
  2. Removed the "truncdesc" option, which was made unnecessary by improvements introduced in version 2.5.1.
5/23/2003: version 2.5.1
  1. When the description is longer than $carpconf['maxdesc'], CaRP now truncates the text more intelligently in three ways:
    • The text will never be truncted in the middle of an HTML tag.
    • Any paired tags that have been opened in the description will be closed, even if the closing tag is in the part that was chopped off.
    • The length of HTML tags no longer counts toward the total length allowed, since they are not actually displayed.
  2. If a newsfeed contains one of the following errors, CaRP now corrects it:
    • If the description ends in the middle of an HTML tag, CaRP removes the broken tag.
    • If the description contains unpaired opening and closing tags, CaRP adds the closing tags.
  3. By default, CaRP now completely removes any HTML tags not listed in $carpconf['descriptiontags'] rather than displaying them like '<tag>'.
  4. Added the ability to add a "title" element to links in order to display the entire item title as a "tool tip" either in cases where it is truncated by the $carpconf['maxtitle'] setting, or to all title links, whether truncated or not.
Version 2.5.0 was never released to the public.

5/21/2003: version 2.4.1

  1. Fixed a bug that prevented 'preitems' and 'postitems' from being displayed when reading from the cache file.
  2. Changed the license for CaRP to the GPL.
  3. Added, by default, a link to the CaRP homepage to the end of each newsfeed.
5/21/2003: version 2.4.0
  1. Added the ability to load redirected RSS feeds. To avoid spending too much time following multiple redirects, you can specify the maximum number of redirects to follow. CaRP also checks for redirections loops.
5/11/2003: version 2.3.0
  1. Added the ability to convert RSS feeds between UTF-8 (Unicode), US-ASCII and ISO-8859-1 character encodings.
5/9/2003: version 2.2.1
  1. You can now specify the maximum number of characters to display from the description field and the text to display (if any) after the description field if it is truncated.
4/22/2003: version 2.2.0
  1. Cache files can now be set to expire at a particular time of day. Previous versions refreshed the cache if it was more than a specified number of minutes old. This version can work either way.
  2. Added the ability to specify text to appear before and after each news item, and before and after the entire list of news items. This makes it possible to put the items in ordered and unordered lists, for example.
  3. Changed the name of the main function from ShowRSSPage to ShowRSSFeed, and made the cache parameter optional. The old function name is still supported for backward compatibility, but may be removed in future versions.
3/26/2003: version 2.1.0
  1. Added support for proxy servers.
  2. Handles improperly encoded "entities" in incorrectly formatted RSS feeds.
  3. Works with PHP installations that don't allow "fopen" to open remote files.
  4. Added ability to set time out for the "CONNECT" phase of slow connections.
  5. Added ability to turn off the sending of the "Host" HTTP header, which one user reported is necessary to work with their particular server.
  6. Added a "User-Agent" HTTP header to identify CaRP.
3/11/2003: version 2.0.1
  1. Removed unnecessary "pass-by-reference" from call to xml_set_object, which generated a warning on some systems.
1/27/2003: version 2.0.0
  1. Dies gracefully if it cannot open or create the cache file.
  2. Moved all configuration into an array (to allow global configuration without the risk of being overridden by malicious website visitors).
  3. Added many new options for formatting, including showing the channel title and description, setting CSS classes and styles for the links, etc.
  4. Added the ability to have links open in a new window.
1/25/2003: version 1.1.1
  1. Dies gracefully if it can't retrieve the remote feed or encounters some other XML parsing error. (The original version was based on code which ended all PHP processing if that happened, meaning that the rest of your page disappeared).
  2. Removed "DIV" from the default set of allowed HTML tags, due to the likelihood of unpaired DIVs disrupting page formatting.
1/24/2003: version 1.1.0
  1. Allows you to specify a set of HTML tags which will NOT be converted to HTML entities in the description field.
  2. Provides a default set of HTML tags to allow in the description field (<b>, </b>, <i>, </i>, <br>, <p>, </p>, <hr>, <span>, </span>, <div>, </div>, <font>, and </font>)
10/24/2002: version 1.0.0
  1. Original implementation based on
  2. Version 1.0.1 and 1.0.2 followed soon thereafter with little tweaks that I don't specifically remember.