Here are the basics of building an RSSBus script/template – the absolute minimum that you’ll need to know. I will probably update this with a few more things before I am done with it.
1. XML
The entire script or template will be constructed with XML. A script outputs an RSS feed, a template outputs any other format, such as HTML. Both contain the same content, except for the rsb:push, which is useful only in a script to “push out” an RSS item.
2. rsb:call
This is the most commonly used RSSBus scripting construct, it is what calls RSS feeds or RSSBus connectors, and brings its data into your script or template. To use it, give it an op attribute whose value is the URL to the RSS/Atom feed you want to retrieve, or the name of an RSSBus connector you want to use. For example:
<rsb:call op=”http://www.nsoftware.com/rss/”>
</rsb:call>
or
<rsb:call op=”fileListDir”>
</rsb:call>
3. Displaying Data
In a template, anything that is not an RSSBus keyword (ie, rsb:call, rsb:set, rsb:push, etc) will be displayed in the result. For example, if your template includes an HTML table, that table will be displayed in the result.
In a script, only well-formed RSS will go out in the result. These RSS items are formed using rsb:call, rsb:set, etc, and then pushed out into the result using rsb:push.
To incorporate RSSBus variables (also called attributes) into your output display, surround the variable names with square brackets (double-square brackets if you are using the RSSBus SharePoint WebPart, ie [[varname]]). For example, to output an rss:title variable, use:
[rss:title]
In a full template, this would look like so:
<rsb:call op=”fileListDir”>
[rss:title]<br />
</rsb:call>
Advanced Documentation
For more advanced documentation, check out the RSSBus Scripting Guide. It includes documentation for how to do things like:
- define script inputs, input default values, and required inputs
- format variable outputs with encodings, capitalizations, mathematical computations, substring replacements, etc.
- verifying that variables are non-null before using them
- saving the results of rsb:calls into temporary variables (useful for sorting output results!)
Technorati Tags: RSSBus