Monday, January 24, 2005

atomCFC - Atom-to-RSS nears beta

First and foremost, big thanks go out to Sean once again, for his patient mentorship and sound advice. And now, on with the story...

So tonight I was asked about my proposed (but unmentioned here, unfortunately) atom-to-RSS feed. I decided I'd better get started on it right then and there, so I said "Yeah, it's almost done" and started writing it. Hey, it's short, so it really was almost done even before I got started.

The story behind it is this: On Tuesday last I began a frantic search for an atom converter to feed RSS aggregators 'cuz Sean told me he'd proferred my blog to fullasagoog.com (which totally rocks!) Unfortunately (or fortunately, depending on how you look at it) the only one I found was missing a namespace attribute in the Items section. The owner of that site was also offering the xsl sheet for download (here) so I grabbed a copy and rewrote enough of it to fix the issue and wrapped it in procedural CF as a fast fix and sent the new URL to the goog. And it worked great.

So, atomCFC is about 95% finished. I have it set up thusly:

Really, there's 2 main methods (5 public altogether):
init()
atomToRSS(atomURI string, xslPath string, xslURI bool = false)

atomToRSS is simply a wrapper for the next 3 methods, I added it because I was planning to use this as a webservice... but it didn't work like I expected so I need to learn more.

The other public methods are:
importAtom(atomURI string)
importXSL(xslPath string,xslURI bool = false)
createRSS()

For both atomToRSS() and importXSL() the xslURI boolean tells the method whether the value in xslPath is a URI (true) or an absolute file path (false), with the default being absolute file path. I've tested it with both local files and remote files, and it does work both ways, so I was pleased.

And finally, createRSS() takes no arguments. It verifies that importAtom and importXSL have executed and if so simply executes transform() against the two values and passes the resulting XML string thru the parsing engine to the setter for rssXML. At the moment, if either importAtom or importXSL (EQ "") it simply exits... I'd rather have it throw an error, but not tonight.

So once I had it working, I went back to the location that I was using to feed the goog and replaced the old procedural code I had running there with the CFC and an index.cfm... lo and behold, the goog didn't even notice. I'm pleased. Very pleased.

But for now, no more throwing errors till tomorrow when I've had a bit of sleep. If you want to see the CFCDoc page for atomCFC, feel free to hit this page for a look.

Cheers!

8 Comments:

At January 24, 2005 9:06 AM, Anonymous Anonymous said...

"this page" isn't for us what it is for you.

http://w2ksrv1/cfcdoc/content.cfm?file= . . .

ends up at a samba list post with the term "w2ksrv1" due to Google search (I think)

 
At January 24, 2005 9:27 AM, Blogger Jared said...

Oi... sorry. And thanks for the feedback...

I'll have to deal with that shortly. I assume it's got something to do with how CFCDoc handles URLs...

 
At January 24, 2005 10:44 AM, Blogger Jared said...

It wasn't anything to do with CFCDoc, it was a 3AM mistake. I just didn't add the domain to the hostname before I pasted it into the entry.

Sorry for that... it's fixed now.

Laterz!

 
At October 14, 2005 5:52 PM, Anonymous Anonymous said...

RSSBlast.com - Imagine thousands of other web sites all displaying your content, and a link back to your web site. All done automatically! Click here: rss promotion.

 
At October 29, 2005 5:37 AM, Anonymous Anonymous said...

Imagine Thousands Of Links Back To Your Web Site From Other People's Blogs!

 
At August 18, 2007 5:45 AM, Anonymous <a href="http://www.xanga.com/buy_levitra">Buy Levitra</a> said...

Great article! Thanks.

 
At August 18, 2007 11:28 AM, Anonymous <a href="http://phentermine1.eamped.com">Phentermine</a> said...

Thanks for interesting article.

 
At September 10, 2007 1:28 AM, Anonymous <a href="http://courses.cvcc.vccs.edu/ENG112_GROSS/_Chat_Room/000008fd.htm">Anonimous</a> said...

Excellent website. Good work. Very useful. I will bookmark!

 

Post a Comment

<< Home