Raymond Camden's Blog Rss

RSS.cfc Update

16

Posted in ColdFusion | Posted on 05-10-2005 | 6,661 views

I've been working on a single CFC to handle RSS work for about 6 months now. (Not straight of course, off and on.) The parsing bit is working quite well I think (with a lot of help from Roger B), but the generating part has been going slowly. I did a bit more work on it today and have got it now generating valid RSS 0.91, RSS 0.92, and RSS 1.0 feeds. It doesn't support all the options available in these feeds, but the idea was to keep it simple. I assume most folks will use it to syndicate simple content. There are no docs - and this is not the 1.0 release (so excuse any guly code), but I thought I'd share what I have so far. The code, and a badly documented example, can be downloaded here.

Comments

[Add Comment] [Subscribe to Comments]

Thanks for sharing, Ray. Realise it's work in progress, but there seems to be a typo at line 572: cfhttp.fileContents with an "s".
Also line 571 -
<cfhttp url="#arguments.data#">

The tag needs closing:
<cfhttp url="#arguments.data#" />
Corrected, although the closing / on cfhttp isn't necessary.
Thanks as this is not the 1.0 release!

I develop in cfeclipse and without closing the chttp tag it doesn't realise the tag had finished, so it was unable to read all the methods/functions.
I checked the generated feed with http://feedvalidator.org
and their seems to be an issue with the dateformat

****validator response****
line 59, column 37: dc:date must be an W3CDTF date (20 occurrences) [help]
<dc:date>2005-05-12T00:00:00+-02:00</dc:date>
**************************

the genrated file is at
http://www.avguide.ch/rss/avguideRSS.xml

also my rss reader mentions invalid dateformat, but I can't figute at what is wrong. Code in RSS.cfc at line 177 seems ok.
This has already been really useful, Ray. Suggestion for further improvement: a charset optional argument for the cfhttp call would help it deal with non UTF feeds. Thanks again.
Hey this looks really good. It actually looks like a couple of functions we are using. I am also using the xmlparse function in Cold Fusion to hack up the rss stuff. Here is a problem that I ran into however. It seems that some people out there have sites that make an xml document and leave some extended ascii characters on the front of the xml contnet. I had to write a function to check it out and make sure that we are only using the standard ascii character set in the beginning and hack off the front characters if they are not standard ascii. I hope this helps you in creating your cfc. Thanks so much for what you guys contribute to this community. If you are interested in this just shoot me an e-mail and i will be happy to help. Thanks a bunch!
Hey Ray,

This has been very helpful. How would I limit the amount of characters in the description that are in the output?

Thanks.
You just use the Left() function normally.
is there any option for parsing the [more] as is used in the main blog page? or just trim it from the descriptions...
Colin - I'm not quite sure I get you. This entry is about rss.cfc, a RSS generator. [more] is a convention that BlogCFC uses, a different product.
Ok - I'll dig around for removing the [more] in the creation of the rss from the blogcfc.

Thanks
Did you modify your code? Mine does not do that. I bet you modified it to support a rich text editor which choked on <more>.
must be time for an update to my blogcfc :)
The link in your post does not seem to work. http://ray.camdenfamily.com/downloads/rss.zip
Just change it to www.coldfusionjedi.com

[Add Comment] [Subscribe to Comments]