Saltshaker: RSS 1.0, easily

Jump to menu

About Saltshaker

Saltshaker uses the MSXML component to generate valid RSS 1.0 (perhaps better called RDF/RSS or XRSS) without using angle brackets. It’s easy to use, because it uses VBScript objects as namespaces.

Download (demo).

Why RSS 1.0?

Because when looking at the specs, it seemed to make more sense. I realise that the difference between the 1.0 spec and the 2.0 spec is (whisper it) actually quite small, but there is a difference. I looked at them, and thought about which would be better for me to parse, if I did that sort of thing, and chose 1.0.

Recent updates

  1. June 2003: added to Aspin and HotScripts.
  2. June 2003: Saltshaker released.

Why no angle brackets?

Because it’s possible to write XML using the DOM rather than as what is effectively tag soup, with an added XML MIME type. Also, I thought it would be cool. It is, although there is some stuff in there that is just lame. For instance, apparently namespace prefixes have to be added by hand, both in the root RDF element and on individual elements and attributes.

How do I use Saltshaker?

Oh, one of the tricky ones. I have provided a demo file for you to poke around with, but a full tutorial and an object reference would be overkill (not necessarily for you, but absolutely for me).

What are the properties and methods for these objects?

If only there were too many to list, then I wouldn’t have to do this.

Contents

RSS

Description

The container object.

Properties

FeedLink
Required. The location of the feed itself.
RestrictLengths
Not required. The RSS 1.0 spec lists recommended maximum lengths for elements and attributes. Set to True to use.
UTCOffset
Not required. The difference between server time and UTC, in hours.
ConditionalGet
Not required. Sends conditional get headers. Only set to True if you’re dynamically generating the RSS, rather than saving it to a static file as needed. The latter is recommended.

Methods

Write
Brings it all together and outputs a string which you can serve straight to the client, or save as a file.

Channel

Description

Child of RSS. Stores children of the channel element (note: this does not include item elements). Can contain CC, DC, and Sy.

Properties

Title
Required. The title/name of your weblog.
Link
Required. The URL of your weblog.
Description
Required. A short description of your weblog.
Image
Required if you are going to use the Image object. This is the URL of the image itself, for instance http://pre.server.tld/folder/image.png. The image should be 88 pixels wide and 31 pixels high. (As long as this is a string that isn’t zero-length, the image object will be used.)
TextInput
Required if you are going to use the TextInput object. This is what would be the value of the action attribute of a form element.

Image

Description

‘Syndication gives no freedom of expression for the designer!’ Wrong, wrong, wrong. You have 1 (one) image to play with, 88 (eighty-eight) pixels wide and 31 (thirty-one) pixels high. They do say that freedom requires restraints, after all.

Oh yeah. Child of RSS, looks after the image element. Can contain CC and DC.

Properties

Title
Required. A bit misleading, this, as it maps to the alt attribute in HTML, not the title attribute.
LinksTo
Required. Where the image should link to, usually the same as Channel.Link.

Item

Description

Child of RSS. An item can technically be anything with a URL, but in practice is mostly a weblog post. Can contain CC and DC.

Properties

Title
Required. Guess.
Link
Required. The item’s URL.
Description
Not required. A short description of the item.
Content
Not required. Actually an implementation of the mod_content module. Can be used to contain the full text of the item, markup and all, because CDATA delimiters are added automatically by Saltshaker.

Methods

AddToFeed
Required if you actually want to do something with that data. Adds the item to the feed and another item in the Seq element.

TextInput

Description

Child of RSS. This is a form that is submitted using get, not post, and is usually a search box. Does not contain any other objects.

Properties

Title
Required. A title for the form field, like ‘Search’.
Description
Required. What the field does.
Name
Required. The name of the variable that will be sent to the server in the form ?name=value.

CC

Description

Child of Channel, Image, and Item. Allows Creative Commons licensing. Does not contain any other objects.

(The latest draft of the mod_cc license does not appear to be where the spec claims, rather it is at Ben Hammersley.com.)

Properties

Use
Required. Set to True to allow CC licensing on any of the listed elements.
License
Required. The URL of the license.
Permits
Required? One or more of the following: Reproduction, Distribution, DerivativeWorks. If more than one is present separate them with the | (pipe) character.
Requires
Required? One or more of the following: Notice, Attribution, ShareAlike. If more than one is present separate them with the | (pipe) character.
Prohibits
Required? Only one suggested value: CommercialUse.

DC

Description

Child of Channel, Image, and Item. Provides Dublin Core metadata. Does not contain any other objects.

Properties

Title, Creator, Subject, Description, Publisher, Contributor, Date, Format, Identifier, Source, Language, Relation, Coverage, Rights
None are required: see the Dublin Core element set for information on each.

Sy

Description

Child of Channel. Tells aggregators how often to check for updates. Does not contain any other objects.

Properties

UpdatePeriod
Not required: defaults to daily. Can be any of hourly, daily, weekly, monthly, yearly.
UpdateFrequency
Not required: defaults to 1. How many times in each UpdatePeriod the feed is updated.
UpdateBase
Required. A base date used to calculate the publishing schedule. Best practice is to assign this to a sate rather than a string, as Saltshaker will convert it.