I've started coding my syndication function recently. For my first attempt I went with RSS version 0.91.
During the development, which I thought was going to be pretty easy until, I realized I needed to strip all the html tags from my logs. While coding, Vee an advocate of PHP, quickly gloated by saying that PHP has a built in function strip_tags() that would do that very thing.
My function aptly named stripTags() looks like this.
Public Function stripTags( textTostrip )
If Len(textTostrip ) > 0 Then
Set objRegExp = New RegExp
objRegExp.IgnoreCase = True
objRegExp.Global = True
strToStrip = objRegExp.Replace(textToStrip, "")
Set objRegExp = Nothing
The above is for those of you who doubted my geekieness.
Next I had to make my last 7 logs XML friendly. I don't know why I chose 7 to display on the main page here, but I thought my feed should be the same as my main page. First I replaced any quotes in the copy, and added /'s to any
tags. Because my function requires a string to be passed, I had to nix the quotes in the img, a href etc. tags too.
That's when I thought the programming gods would get mad at me. It took all of my willpower to do this. I'm an advocate of proper syntax. Assign property values without quotes?! Am I going to go to hell?
Another pre-built function PHP has that would have been helpful is htmlspecialchars. This does the conversion of the ampersands and quotes.
I realized that I may want to look at changing from ASP at some point, but today is not the day. I was quite pleased with myself for getting the job done using ASP.
For some reason all this talk of feed(ing) is making me hungry. I think I'll head to Cedars for the house chicken.
Ladies and Gentlemen... my feed.