Devlico.Us
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @devlicious

Derik Whittaker

Thoughts on Software Development, .Net, OOP, Design Patterns and all things cool



How to Foo-up your RSS feed with a single /

So today I got an IM from Chris Sutton telling me that my RSS feed for DimeCasts.Net was not working.  So being the paranoid guy I am, I immediately started to run in circles like Chicken Little yelling "The Sky is falling, the Sky is falling".  It was not till I became horse and ran out of breath did I realize I needed to fix the thing.

The first thing I did of course was to test the thing, and sure enough Chris was NOT lying (you never know about those guys from Iowa), but what was the cause.  I knew it had worked the day before, what happened.  Oh yea, I actually setup the RSS generation to be a automated process, not manual.

Because I am so new to RSS, and have never created a feed document before I did not want to take the time to learn some third party API (like rss.net) so I hand rolled my own logic to build the XML Document (don't worry, apart from the data access, it is all of 20-25 lines of code).  Turns out that I put an extra '/' in the URL in the link node under the channel (below in RED).
<channel>
   <title>DimeCasts.Net -- Inform and Educate in ~ 10 minutes or less</title>
   <link>http://www.DimeCasts.Net/</link>

For some reason (again, not an RSS guru) when this happens the URL's for each item gets fooed up.  After a few simple keystrokes the problem was fixed, and as it turns out the sky was not falling.

So what is the moral of this story?  No matter how 'simple' the change, shit can go wrong in a hurry.

Till next time

(P.S., check out DimeCasts.Net)


Published May 29 2008, 12:06 PM by Derik Whittaker
Filed under:

Comments

Derik Whittaker said:

@Woj

Admittedly i did not have nice unit test coverage, or better put quality coverage.  I had the data access covered and that the correct number of items where put into the xml doc, but did not verify each piece of data.

However in this case I did not know that having the trailing / was an issue.

# May 29, 2008 4:49 PM

Andrew Pennebaker said:

I'm managing a site like TinyURL, in which users enter URLs to be shortened to tinier ones. I too generate an RSS feed dynamically. In this case I expect a lot of feed items to contain the slash. I guess I should be HTML escaping the URLs then, no?

# June 4, 2008 4:43 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Derik Whittaker

Derik is a .Net Developer/Architect specializing in WinForms working out the northern suburbs of Chicago. He is also believer and advocate for Agile development including SCRUM, TDD, CI, etc.

When Derik is not writing code he can be found spending time with his wife and young son, climbing on his bouldering wall, watching sports (mostly baseball), and generally vegging out. Check out Devlicio.us!

Our Sponsors

Red-Gate!