feed me
11/22/2004 7:11:00 PM

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 )
Dim objRegExp
If Len(textTostrip ) > 0 Then
Set objRegExp = New RegExp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern= "<[^>]+>"
strToStrip = objRegExp.Replace(textToStrip, "")
Set objRegExp = Nothing
End If
End Function

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.

Link | 8 Comments
This was automagically filed under geek

<<<< Previous bling Next blong >>>>
Last 10 entries
two thousand and seventeen : 1/31/2017 : 4:44:00 PM
Luck, awareness and quantum entanglement : 11/19/2016 : 11:11:00 AM
the black journal : 10/18/2016 : 8:53:00 PM
Not aware of the tulips : 9/29/2016 : 2:30:00 PM
The practice : 8/9/2016 : 9:07:00 PM
Filling up my cup : 7/20/2016 : 11:41:00 PM
Happiness and intelligence : 7/7/2016 : 11:11:00 PM
My departure from Technology. : 5/27/2016 : 2:32:00 PM
Introducing the Zenbit 1.0 beta. : 1/15/2016 : 6:14:00 PM
Metric : 9/17/2015 : 10:50:00 PM