How to limit the description size in RSS feed?

2010-09-09 23:59:41

JDO2010

Is there a way to limit the number of characters or words that will be shown by rsslib? Even better if it would put a "..." at the end of the description that is shown if it would need to cut if off.
Jeremy

2010-09-10 11:32:40

scriptol

In RSS_Tags
After:

$description = $tnl->firstChild->textContent;

you can add:

$description = substr($description, 0, 150)."...";

Replace 150 by the size you want.
This could be improved by a regular expression to break the text after a dot. I'll try to retrieve the code I have already somewhere.

2010-09-10 16:41:35

JDO2010

Thanks for the help. It worked out great.

2010-09-15

Duc

I've been using your lib for business purpose, could you please give me the permission to modify it?
I need to add a function like this: