Software: RSS and CaRP

mtrac

Enthusiast
Joined
Nov 4, 2004
Messages
197
mtrac submitted a new Article:

Software: RSS and CaRP

Introduction

I run a community-oriented VBulletin BBS and VBAdvanced Portal. This article is based on my experience as both a provider and user of RSS feeds.

What is RSS?

RSS is an abbreviation for Really Simple Syndication. You can get the technical details at http://blogs.law.harvard.edu/tech/rss. Also see http://www.geckotribe.com/rss/about-rss.php. Rather than worrying about what it is, you should think about what it can do for you as an administrator:
  • You can distribute your board’s latest content to anyone with an RSS reader who wants it. That includes other areas of your board. Users don’t even have to visit, unless they see something that interests them. If you use VB, I recommend this hack: http://www.vbulletin.org/forum/showthread.php?t=69834.
  • You can get fresh, free content for your site from throughout the Internet. RSS feeds aren’t limited to news and geek sites; even the venerable Farmer’s Almanac has several. Some sites that normally require registration, such as the New York Times, give RSS users a free pass. But how to pull feeds? With CaRP.
What is CaRP?

A PHP-based Caching RSS Processor available at http://www.geckotribe.com/rss/carp. CaRP can take pretty much any RSS feed, including a non-compliant one, and generate HTML from it. Its power comes from its caching, formatting, and filtering capabilities. It is also fairly easy to use. Two lines of code will get you on your way.

The GPL version is free, but you will probably need to purchase a more capable version as you get deeper into RSS. It’s not expensive. There is a feature comparison at http://www.geckotribe.com/rss/carp/features.php.

Installing CaRP

Download and follow the directions. The semi-automated installation didn’t work for me, and so required manually changing access permissions. For many of you this may be second nature, but the last time I had to worry about, let alone change, *NIX permissions was on a PDP-11/70 around 1983. I used my ISP’s utility. You’ll also need to understand your directory structure, which won’t look like your URL.

CaRP’s author offers an installation service if you get in over your head. You might – I’m not the only one I know who initially had trouble. You can also try seeking assistance at http://www.voy.com/188105/.

All installed! Now what?

Two pieces of advice....

Read more about this article here...
 
Last edited by a moderator:

Neutral Singh

SPN Administrator
Joined
Aug 22, 2004
Messages
238
Thanks for the article, it made a very informative reading... keep it up !!
 

Kevin

Oooh, something shiny!
Joined
Jul 13, 2004
Messages
3,450
mtrac, very nice. :cool:

Would you mind if I linked to this thread when asked about the topic? The subject of RSS feeds and portals seems to come up every so often so this would be good reading for them.

Thanks,
Kevin
 

Tdot

(L) learner
Joined
Nov 10, 2004
Messages
116
this is a gr8 article.

Can CarP be used to submit news feed to a forum/subforum or vBulletin??
 

mtrac

Enthusiast
Joined
Nov 4, 2004
Messages
197
WeatherClicks advised me that their free RSS feed is discontinued effective April 12, 2005.
 

hocus

Neophyte
Joined
May 30, 2005
Messages
4
Thanks for a great posting. I just started using CaRP today and was lost at first until reading this article. I do have a question though.
Is there a CarpConf statement to cause links in the feed to open to target="_blank"? I honestly don't have a clue how to do this within the script and it's running beautifully right now, so I don't want to mess it up. Any help would be greatly appreciated. Thanks again and have a happy Memorial Day.....
 

DaUnknownAdmin

What Are You Missin?
Joined
Nov 22, 2004
Messages
740
After reading the article I decided to jump in feet first so to speak and give it try. I was able to install and setup quite easily. But quickly hit a wall when I tried to use a different site's feed.

I tried using two different site and I got the same error.

[CaRP] Connection refused (111)

I'm guessing that this means the refusal came from the site that I'm linking to. Anyone have any thoughts?

BTW Thanks for the article, I've been wanting to try this and reading this post made it painless.
 

mtrac

Enthusiast
Joined
Nov 4, 2004
Messages
197
Try the following. Also, tell the people at quacked that the links in their feed are bad. If you take a look at it you'll see what I'm talking about. The editzplanet feed is fine as is.


PHP:
<?php
	require_once '/path/to/carp/carp.php';
	CarpConf('outputformat',2);
	CarpShow('http://www.quacked.com/index.php?rss');
	$carpoutput=str_replace('http://www.quacked.com/http:','http:',$carpoutput);
	echo $carpoutput;
	echo '<p>';
	CarpConf('outputformat',0);
	CarpShow('http://www.editzplanet.com/modules/newbb/rss.php');
?>
 

DaUnknownAdmin

What Are You Missin?
Joined
Nov 22, 2004
Messages
740
mtrac said:
Try the following. Also, tell the people at quacked that the links in their feed are bad. If you take a look at it you'll see what I'm talking about. The editzplanet feed is fine as is.


PHP:
<?php
	require_once '/path/to/carp/carp.php';
	CarpConf('outputformat',2);
	CarpShow('http://www.quacked.com/index.php?rss');
	$carpoutput=str_replace('http://www.quacked.com/http:','http:',$carpoutput);
	echo $carpoutput;
	echo '<p>';
	CarpConf('outputformat',0);
	CarpShow('http://www.editzplanet.com/modules/newbb/rss.php');
?>

Didn't work for me :hopeless:
But I appreciate the effort.

[CaRP] Connection refused (111)

[CaRP] Can't open remote newsfeed.


[CaRP] Connection refused (111)

[CaRP] Can't open remote newsfeed.
 

mtrac

Enthusiast
Joined
Nov 4, 2004
Messages
197
WhatChaMissin said:
Didn't work for me :hopeless:
But I appreciate the effort.
What happens when you click on the two links you posted initially? Do you get XML?
 

DaUnknownAdmin

What Are You Missin?
Joined
Nov 22, 2004
Messages
740
mtrac said:
What happens when you click on the two links you posted initially? Do you get XML?
Sorry I'm such a n00b, but XML is that this?

Code:
 <?xml version="1.0" encoding="UTF-8" ?> 
- <rss version="2.0">
- <channel>
  <title>Editz Planet.Com :: Forum</title> 
  <link>http://www.editzplanet.com/</link> 
  <description>"Music Evolved" :: Forums module for XOOPS</description> 
  <lastBuildDate>Wed, 1 Jun 2005 12:53:43 PDT</lastBuildDate> 
  <docs>http://backend.userland.com/rss/</docs>

If so, yes they both displayed a page that looks like html code on crack :D
 

shiola

Participant
Joined
Mar 17, 2005
Messages
62
Can someone explain the basic differences between Carp and zFeeder? I've just installed zFeeder, but then recently found Carp and was wondering if I should switch to Carp or stick with zFeeder?

What are the advantages of Carp and zFeeder?
 

offordscott

Neophyte
Joined
Jan 12, 2006
Messages
4
Here' s what I'm testing out. I've added a bit of CSS for formating. And have discovered an alternative way to remove descriptions from items, by setting the "maxidesc" tag to "-1" character length and leaving the "desc" declared in the iorder "tag":

Code:
CarpConf('maxidesc',-1);
CarpConf('iorder','link,desc');

Can anyone tell me if there is anything else (tag, functions, etc), I could/should include or take out to make it run more smoothly in general?

Code:
<style type="text/css">
<!--
#rsschannel {
	border-top-width: thin;
	border-right-width: thin;
	border-bottom-width: thin;
	border-left-width: thin;
	border-top-style: solid;
	border-right-style: solid;
	border-bottom-style: dotted;
	border-left-style: solid;
	border-top-color: #000000;
	border-right-color: #000000;
	border-bottom-color: #000000;
	border-left-color: #000000;
	padding-bottom:3px;
	padding-left:10px;
	padding-right:10px;
	padding-top:5px;
	width: 250px;
	background-color: #FFCCCC;
	clear: both;
	overflow: auto;
}

#rssitem {
	border-top-width: thin;
	border-right-width: thin;
	border-bottom-width: thin;
	border-left-width: thin;
	border-top-style: none;
	border-right-style: solid;
	border-bottom-style: solid;
	border-left-style: solid;
	border-top-color: #000000;
	border-right-color: #000000;
	border-bottom-color: #000000;
	border-left-color: #000000;
	padding-bottom:5px;
	padding-left:10px;
	padding-right:10px;
	padding-top:5px;
	width: 250px;
	background-color: #FFFF66;
}
#wrap {
	margin: 0px;
	padding: 0px;
	height: auto;
	width: 250px;
}

.channeltitle {
	font-size: medium;
	font-weight: bold;
}
.channeldescriptions {
	font-size: x-small;
	font-style: italic;
	font-weight: bold;
}
.itemtitle {
	font-size: x-small;
	font-weight: bold;
}
.itemdescriptions {
	font-size: xx-small;
}
a:link {
	color: #000033;
}

a:visited {
	color: #330033;
}

p {
	font-family: Geneva, Helvetica, Verdana, Arial, sans-serif;
	margin: 0px;
	padding-bottom: 7px;
	padding-left: 0px;
	padding-top: 0px;
	padding-right: 0px;
}
-->
</style>
<div id="wrap">
<?php

require_once '/home/content/html/carp/carp.php';  // change to match document_root

CarpConfReset();

CarpClearCache(0);

CarpConf('descriptiontags','i|/i|b|/b|em|/em|strong|/strong');
CarpConfRemove('descriptiontags','a|/a|p|/p|div|/div|pre|/pre|font|/font|span|/span|h1|/h1|h2|/h2|h3|/h3|h4|/h4');

CarpConf('maxitems',5);				// limiting # of items per feed

CarpConf('cborder','title,desc');	
// channel image,link,date,desc,title,url

CarpConf('iorder','link,desc');			 
// item image,link,date,desc,title,url,author

CarpConf('maxctitle',55);					// max channel title length 
CarpConf('atruncctitle','...');					// if channel title is truncated

CarpConf('maxcdesc',65);					// max channel desc length 
CarpConf('atrunccdesc','...');  				// if channel desc is truncated

CarpConf('bcb','<div id="rsschannel">');			// before whole channel
CarpConf('acb','</div>');							// after whole channel

CarpConf('bctitle','<p class="channeltitle">');		// before channel title
CarpConf('actitle','</p>');						// after channel title

CarpConf('bcdesc','<p class="channeldescriptions">');	// before channel description
CarpConf('acdesc','</p>');				// after channel description


CarpConf('maxititle',65);					// set max item title length 
CarpConf('atruncititle','...');				// if title is truncated

CarpConf('maxidesc',345);				// max item description length 
CarpConf('atruncidesc','...');  			// if description is truncated

CarpConf('bitems','<div id="rssitem">');		// before all items
CarpConf('aitems','</div><br />');			// after all items

CarpConf('bilink','<p class="itemtitle">'); // before link
CarpConf('ailink','</p>');				// after link

CarpConf('bidesc','<p class="itemdescriptions">');	// before each description
CarpConf('aidesc','</p>');				// after each description

CarpConf('poweredby','');				// remove "powered by carp" line

//CarpConfAdd('descriptiontags','|img|a|/a');	// for allowing images in feed

CarpConf('shownoitems',1);			// 0 = disabled (shows empty feeds), 1 = enabled (hides empty feeds)
CarpConf('noitems','');				// if filter returned no items

CarpConf('carperrors',0);							// do not display carp errors, 0,1
CarpConf('phperrors',0);			// do not display php errors, 0,-1


CarpConf('cacheinterval',10);		// refresh every ## min 

// set up the filtering
CarpConf('filterout','gambling|poker|advertizing|marketing');

CarpCacheShow('http://search.msn.com:80/results.aspx?q=%22Scott+Offord%22&format=rss&FORM=RSRE');

CarpCacheShow('http://rss.jobsearch.monster.com/rssquery.ashx?WT.mc_n=RSS2005_jsr&fn=660');

CarpCacheShow('http://www.ediets.com/rss/indexxml.xml');

?> 
 </div>


Thanks,
Scott Offord
http://scottofford.com/
 
Top