Greg
06-06-2005, 12:06 PM
This is not a tutorial on installing carp rss, the intent here is to show you how to use carp rss after it's setup. However, feel free to ask questions on setup and such. But we'll assume you have carp rss installed and working and want to tweak/configure it.
Let's walk through the basic settings we use. There are many, others may use more or less.
We have to deal with formatting descriptions and items. This is our example.
Channel Formatting Options (http://www.geckotribe.com/rss/carp/docs/conf/display/channel/)
This is usually required to display. You show the provider as recognition for using the feed. How you have to display it may vary, some sites may not require it, most do. That's on you to be a fair player. So let's display a few of the available pieces of information.
You use the CarpConf() function to set the configuration. First argument is the setting, next are the settings.
CarpConf('cborder','image,title,link,desc');
This will display four parts of the channel info. Description, link to the feed, the feed image if available and the Title of the feed. This will be formatted pretty well on display. Image first, title, link, then description.
Let's set the length of the description for the channel with CarpConf() now.
CarpConf('maxcdesc',300);
That tells carp to display up to 300 characters of any description provided.
Now let's do the default image format from a carp example.
We will use the CarpConf() function to set what html code gets put before and after the image as well as what size to tell the html code to define in the img tag.
CarpConf('bcimage','<div style="float:left;margin-right:5px;">');
CarpConf('acimage','</div>');
CarpConf('maxcimagew',200);
CarpConf('maxcimageh',100);
The above puts the image in a div, left justified with a five pixel border on the right side. It tells carp to make the img tag size parameters 200x100 pixels.
Now we just need a space after the Channel info and we can move on to the news items. To put html breaks after the channel info for spacing we use the CarpConf() function again...
CarpConf('acb','<br /><br />');
That will tell carp to put two html breaks after the channel info for spacing.
Let's do the items now. It's the same proceedure with different CarpConf() settings.
Item Formatting Options (http://www.geckotribe.com/rss/carp/docs/conf/display/item/)
First we set what we will display with CarpConf()...
CarpConf('iorder','link,date,author,desc');
Again we have four pieces of data. Link, Date, author and description. Most feeds require you to display that much for them to make sense. This is up to you however.
Now lets do some display settings.
CarpConf('maxidesc',600);
CarpConf('maxititle',400);
CarpConf('maxitems',10);
The above set the Length of the description, the news feed article title and the number of items to display if that many are available.
The description is one you can play with. The more you show, the better the content.
The title we set long always. We use alot of yahoo! news feeds and the TOS says to display it all and we try to comply with that setting high to display all characters in the title.
Maxitems will tell carp how many of the available article items to display. I'll go out on a limb and say alot of feeds only supply 10 items at a time.
Item links can be controlled as to how they open. This setting will make the item links open in a new window.
CarpConf('linktarget',1);
This is usually a benefit as when they close the opened window, folks are back at your site.
Caching your Carp RSS News Feed
Caching your feed will make it so that your site only requests a news feed at a certain interval. Every specified time period, carp will make a call for the news and store a copy locally. This is a performance benefit for both us and the feed provider. You should always use this and the general rule is fetch at least 60 minutes apart.
CarpConf('cacheinterval',60);
That will tell carp to update the cache every 60 minutes and display the local copy any other time.
That's the basics. If you have any questions, post and we'll build on what we have.
Attached is a template in php to get you started with one single predefined feed from yahoo! news.
Here is the Carp RSS News Feed Template (http://www.lakecs.com/carptemplate.php) demo.
Regards.
Let's walk through the basic settings we use. There are many, others may use more or less.
We have to deal with formatting descriptions and items. This is our example.
Channel Formatting Options (http://www.geckotribe.com/rss/carp/docs/conf/display/channel/)
This is usually required to display. You show the provider as recognition for using the feed. How you have to display it may vary, some sites may not require it, most do. That's on you to be a fair player. So let's display a few of the available pieces of information.
You use the CarpConf() function to set the configuration. First argument is the setting, next are the settings.
CarpConf('cborder','image,title,link,desc');
This will display four parts of the channel info. Description, link to the feed, the feed image if available and the Title of the feed. This will be formatted pretty well on display. Image first, title, link, then description.
Let's set the length of the description for the channel with CarpConf() now.
CarpConf('maxcdesc',300);
That tells carp to display up to 300 characters of any description provided.
Now let's do the default image format from a carp example.
We will use the CarpConf() function to set what html code gets put before and after the image as well as what size to tell the html code to define in the img tag.
CarpConf('bcimage','<div style="float:left;margin-right:5px;">');
CarpConf('acimage','</div>');
CarpConf('maxcimagew',200);
CarpConf('maxcimageh',100);
The above puts the image in a div, left justified with a five pixel border on the right side. It tells carp to make the img tag size parameters 200x100 pixels.
Now we just need a space after the Channel info and we can move on to the news items. To put html breaks after the channel info for spacing we use the CarpConf() function again...
CarpConf('acb','<br /><br />');
That will tell carp to put two html breaks after the channel info for spacing.
Let's do the items now. It's the same proceedure with different CarpConf() settings.
Item Formatting Options (http://www.geckotribe.com/rss/carp/docs/conf/display/item/)
First we set what we will display with CarpConf()...
CarpConf('iorder','link,date,author,desc');
Again we have four pieces of data. Link, Date, author and description. Most feeds require you to display that much for them to make sense. This is up to you however.
Now lets do some display settings.
CarpConf('maxidesc',600);
CarpConf('maxititle',400);
CarpConf('maxitems',10);
The above set the Length of the description, the news feed article title and the number of items to display if that many are available.
The description is one you can play with. The more you show, the better the content.
The title we set long always. We use alot of yahoo! news feeds and the TOS says to display it all and we try to comply with that setting high to display all characters in the title.
Maxitems will tell carp how many of the available article items to display. I'll go out on a limb and say alot of feeds only supply 10 items at a time.
Item links can be controlled as to how they open. This setting will make the item links open in a new window.
CarpConf('linktarget',1);
This is usually a benefit as when they close the opened window, folks are back at your site.
Caching your Carp RSS News Feed
Caching your feed will make it so that your site only requests a news feed at a certain interval. Every specified time period, carp will make a call for the news and store a copy locally. This is a performance benefit for both us and the feed provider. You should always use this and the general rule is fetch at least 60 minutes apart.
CarpConf('cacheinterval',60);
That will tell carp to update the cache every 60 minutes and display the local copy any other time.
That's the basics. If you have any questions, post and we'll build on what we have.
Attached is a template in php to get you started with one single predefined feed from yahoo! news.
Here is the Carp RSS News Feed Template (http://www.lakecs.com/carptemplate.php) demo.
Regards.