Uncategorized

A tidbit of geeky fun

So a long, long time (two years?) ago I made a little teeny ASP app to allow me to write and post my little book reviews. Copy/paste, and you’ve also got the apps for the old Mandrake and newer Gentoo sections of the site.

However, because these are home-brewed things, they don’t come with any frills, like RSS feeds. So this weekend, I found an ASP class to do it for me. Following the demo (with some tweaks, described below), with a single, minor change to the class itself (described below), I now have RSS 1.0 syndication for the (rarely-updated, admittedly) Gentoo and Book Review areas.

I don’t know how nice the feeds are yet. I’m basically recreating the entire XML file every time I update or add a post, so feed readers may go on the blitz and show the latest five entries every time I make a change. I’m not sure how much more tweaking I want to do with this if that’s the case, but we’ll see. I also suspect there are going to be date problems, but weren’t there always, with RSS 1.0 feeds?

(In other geek-news, what’s up with GMail servers going down as soon as I press the submit button to create my account [invite courtesy of Luke]? Is this an omen?)

All non-geeks are free to now depart. Now for a whirlwind account of getting Saltshaker to work.

Where entries are added in my little app, I pasted the demo so handily provided with Saltshaker. I changed the relevant values to reflect my feed/app (RSS.FeedLink is https://irrsinn.net/feed/, for instance). The ConditionalGet must be set to false if the feed is being stored in a file. It’s embarrassing how long it took me to realize that that one detail was what was keeping my feed from storing itself on the server.

Since my entries are stored in a database, I created a temporary recordset and set a corresponding SQL query to grab entries by date and time. Then I put a loop around the RSS.Item creation for the five entries I wanted.

Rather than letting the script perform a Response.Write after all the Items are created, I used a FileSystemObject to create a text file (my reviews.xml or gentoo.xml) and wrote the results of RSS.Write() to the text file. I closed up the recordsets, file system objects, and text files, copied to where the app modifies entries, and tested (using modifications instead of new entry creations, for the sake of my database).

One itty-bitty detail in the Saltshaker class needs to be changed before the feed can be validated–near the bottom of the file, there is a Select Case statement for the conversion of data into certain standards. In the W3CDTF case (which converts a date into the W3C Date and Time Format, the time offset (as in time zone) is gathered using “TryHarder(RSS.UTCOffset)”. I haven’t the faintest clue what or where the TryHarder() function is declared, but it ain’t in this file, and it’s returning invalid values. So just make that line “Offset = RSS.UTCOffset”, and it’ll work correctly and the feed will validate. (I notified the author of this problem, so (s)he’s aware of it.)