CaRP: Caching RSS Parser - Manual
     Version 3.5.4 (10/7/2004)

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 | Upgrading from version 2 | Functions | Examples | Donations

Old documentation: Version 2

Examples:
Styles & Classes | Multiple Feeds on a Page | Unordered List | Background Refreshing | Filtering | Aggregating 1 | Aggregating 2 | Amazon.com Associates | JavaScript

This code will select items containing any of the words "Microsoft", "Oracle", "Sun", or "IBM" in either the title or description from two different newsfeeds, and display the four most recent. Note that the newsfeeds must contain either a pubDate or dc:date field for their items in order to correctly select the most recent stories:

<?php
require_once "/path/to/carp.php";

// don't display any channel fields
CarpConf('cborder','');

// display a bullet before each item
CarpConf('bi','&bull ');

// set up the filtering
CarpConf('filterin','microsoft|oracle|sun|ibm');

// show up to 4 items
CarpConf('maxitems',4);

// show upt o 100 characters from the description
CarpConf('maxidesc',100);

// refresh every 2 hours
CarpConf('cacheinterval',120);

// Filter each newsfeed and cache the results
CarpCacheFilter("http://slashdot.org/index.rss", "agg2-slashdot");
CarpCacheFilter("http://www.infoworld.com/rss/columnists.rdf", "agg2-infoworld");

// combine the results from the two newsfeeds
CarpAggregate('agg2-slashdot|agg2-infoworld');
?>
Example Output:


[CaRP] Can't open remote newsfeed [404].

[CaRP] Cache file not found.
Apple CEO Tim Cook: I'd Require All Children To Start Coding In 4th Grade
by EditorDavid
28 May 2016 at 8:30pm
This week Apple CEO Tim Cook argued at Startup Fest Europe that coding should be a 'second langua...
Op-ed: Oracle Attorney Says Google's Court Victory Might Kill the GPL
by manishs
28 May 2016 at 6:30pm
Annette Hurst, an attorney at Orrick, Herrington & Sutcliffe who represented Oracle in the recent...
Mark Zuckerberg Is Dictator Of Facebook Nation; There's No Democracy Online: ...
by manishs
28 May 2016 at 1:30pm
Facebook CEO and co-founder Mark Zuckerberg is the "dictator" of "the biggest nation in the world...
Department of Homeland Security Still Uses COBOL
by EditorDavid
28 May 2016 at 9:30am
The Department of Defense has promised to finally stop managing the U.S. nuclear arsenal with flo...