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

The following code will display two feeds on the same page with the same formatting. Notice how you only need to "require_once" once. Also notice that CaRP will display up to five items from each feed, not a total of five:

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

// only show the item link
CarpConf('iorder','link');

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

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

// don't say "Newsfeed display by by CaRP" after the newsfeeds
CarpConf('poweredby','');

// Show the first newsfeed
CarpCacheShow('http://nwt.mouken.com/rss/headlines.rdf');

// Leave some space betwwen the newsfeeds
echo '<p>';

// show the second newsfeed
CarpCacheShow('http://antone.mouken.com/dreams/rss/antone.talk.1.rdf');
?>

The following code will display two feeds on the same page. The first will have a bullet before each item. The second has all of its settings reset to the defaults by calling the function CarpConfReset(), and then the maximum number of items to display set to 5. In such a simple example, you would usually just add a line like "CarpConf('bi',"");" to reset the one configuration setting that had been overridden, but CarpConfReset() can be useful when you've overridden a number of options for one feed and then wish to display another feed with significantly different formatting.

Note that it is a good idea to set up background refreshing when accessing many newsfeeds from the same page:

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

// same settings as the previous example
CarpConf('iorder','link');
CarpConf('bi','&bull; ');
CarpConf('poweredby','');
CarpCacheShow('http://nwt.mouken.com/rss/headlines.rdf');
echo '<p>';

// reset all settings to their defaults
CarpConfReset();

// make any desired changes again
CarpConf('iorder','link');
CarpConf('poweredby','');
CarpConf('maxitems',5);
CarpCacheShow('http://antone.mouken.com/dreams/rss/antone.talk.1.rdf');
?>
Example Output:

Two with the same formatting:
Alpha Gecko : The Divined Comedy
<p>Visions of a curious future</p>

“Prehistoric Comedy”: Back to the future we go
“Douglas Ankara”:
“Each morsel”: the straw that saved the camel’s back
“Tint apart”: the return of x-ray specs?
“Attain Bangkok”: tennis balls a precursor to war?

Antone's Dreams
Antone's Dreams

In Control Of Your Enviroment
Hanging with Ozzy
Saddam the Red and the Essenes
Basketball with Alan Alda
Sing it: "Why is everything so lame?"

Two with different formatting:
Alpha Gecko : The Divined Comedy
<p>Visions of a curious future</p>

“Prehistoric Comedy”: Back to the future we go
“Douglas Ankara”:
“Each morsel”: the straw that saved the camel’s back
“Tint apart”: the return of x-ray specs?
“Attain Bangkok”: tennis balls a precursor to war?
“Tasmania plough”: mutating aphids
“Arrogant hermit”: Arthur versus the badger
“Escalator duty”: hedonism in the sub-continent
“Silent fuse”: the biggest party ever
“Agrarian daughter”: taking Korea back to its roots?

Newsfeed display by CaRP

Antone's Dreams
Antone's Dreams

In Control Of Your Enviroment
Hanging with Ozzy
Saddam the Red and the Essenes
Basketball with Alan Alda
Sing it: "Why is everything so lame?"

Newsfeed display by CaRP


"I wanna ride the pony!"
Chess players on the web have a free place to play at Chess Hounds. Here you play in your web browser, not some proprietary chess program, so firewalls don't get in the way like they do with most proprietary systems. Come ride the pony!