HOW-TO: Customize RSS Syndication with xml.rss.renderWithTemplate

Radio UserLand offers some incredible possibilities for displaying RSS feeds that are readily available on the web with your own RU weblog. Here is a list of popular sites . This page will help you learn how to use the xml.rss.renderWithTemplate verb built into RU that makes displaying syndicated RSS feeds a snap.

xml.rss.renderWithTemplate gives you much more flexibilty than xml.rss.viewRssBox if you want to do a lot of custom formatting of the feed on your site. This document assumes that you have already read through the documention for the xml.rss.renderWithTemplate verb, and have a basic idea what it does. This How-To expands on that documentation and gives you a few examples of custom formatting with this verb.


Subscribing To RSS Feeds

In order for you to render RSS feeds, you first must subscribe to them. Though you will see the URL of an RSS feed in the xml.rss.renderWithTemplate macro, it does not call the feed. It is looking for a table in the aggregatorData.root (a file used by Radio UserLand).

When you install Radio UserLand, you will find that a number of popular services have already been subscribed for you. You can remove any of the subscriptions that are provided, or add your own. On many RU and Manila-managed sites, you will see the XML coffee cup (at right). If you are running RU on your desktop, simply clicking on this graphic will add that RSS feed to your subscriptions. Clicking on the graphic to the right will subscribe you to my "Radio Keola" RSS feed. If you know the URL of the RSS feed you want to subscribe to, you can manually enter it on your subscriptions page.


Some Examples

All of the following examples work. I've copied each macro from a web browser into RA, and it processed the macros fine. The only error you should see is if you try to use them without having subscribed to the RSS feeds in the macro.


Dictionary.com Word of the Day

You can have the Dictionary.com word of the day appear on your page - the caveat being that it will only update when you run Radio Userland. So if you don't use RU for a few days, your site will continue the display the WOTD of the last used RU. If you have not already subscribed to WOTD, click on the XML coffee cup to the left of the link above. The link itself is generated by the macro displayed below.

[Macro error: Can't find a sub-table named "http://www.dictionary.com/wordoftheday/wotd.rss".]

<%system.verbs.builtins.xml.rss.renderWithTemplate (@aggregatorData.services.["http://www.dictionary.com/wordoftheday/wotd.rss"], "{items ()}", "{itemText()}", "Dictionary.com Word of the Day", 1, "HST")%>


Wired News

Wired News
Last Updated - 6/29/2003

  • Yahoo Spam Filter Thwarts FTC. While hundreds of thousands of Americans rush to sign up for the Federal Trade Commission's new do-not-call service, many Yahoo users are left wondering why they haven't received their registration confirmation. The reason? Yahoo's spam filter doesn't like the FTC's onslaught of e-mail. By Amit Asaravala.
  • It's Raining ID-Theft Bills. With a key piece of credit reporting legislation set to expire, lawmakers propose an array of bills this week designed to curtail the spread of identity theft, through high and low-tech means. By Joanna Glasner.
  • Online Voters Lean to Dean. Former Vermont Gov. Howard Dean emerges as front-runner among nine Democratic presidential candidates in an unoffiicial online primary that drew more than 300,000 voters. By Joanna Glasner.
  • Bill to Force Data Theft Notices. A California senator introduces a bill that would force companies to notify customers if sensitive personal data is stolen. Privacy advocates are all for it. By Ryan Singel.

This is the Wired News feed in an unordered list. The macro for this appears below:

<%system.verbs.builtins.xml.rss.renderWithTemplate (@aggregatorData.services.["http://www.wired.com/news_drop/netcenter/netcenter.rdf"], "<b>{sourceTitle()}</b><BR><i>Last Updated - {updatetime()}</i><p><UL>{items ()}</UL>", "<LI>{itemText()}", "Wired News", 4, "HST")%>



Digital Photography Review (dpreview.com)

This example above uses a bit of fancier table formatting with two columns and adds a graphic before each item. Macro appears below. Note that you must use forward slashes if you include quotation marks in the macro, as I have to specify colspan, class, size and alignment values.

Digital Photography Review (dpreview.com)
Last Updated - 6/29/2003
Canon post EOS-10D firmware 1.0.1. Canon has posted EOS-10D firmware 1.0.1 on its BeBit website. Copies of this firmware have been floating around the Internet for a few days now, this is the first official copy and installation guide. This...
Leica Digital Modul R for the R8 & R9. Leica has today announced the development of a Digital Module for the Leica R8 & R9. This new module has a ten megapixel Kodak sensor and has been developed in association with Imacon. The module is made up...
Olympus aim for 90,000 E-1's a year. In a very interesting story published on Nikkei BP Olympus are said to be aiming for sales of 90,000 units of their recently announced E-1 digital SLR this fiscal year (from now to end of March 2004). Global...
Olympus E-1 detailed preview. 1500 CET: The embargo is over and we can finally bring you our detailed preview of Olympus's long awaited E-1 digital SLR. We had just under 48 hours with a pre-production camera, just long enough for me to...

<%system.verbs.builtins.xml.rss.renderWithTemplate (@aggregatorData.services.["http://www.dpreview.com/news/dpr.rdf"], "<table border=\"0\" bgcolor=\"antiquewhite\" width=\"500\" cellpadding=\"3\"><TR><TD colspan=\"2\" class=\"small\"><B>{sourceTitle()}</b><BR><i>Last Updated - {updatetime()}</i></TD></TR>{items ()}</TABLE>", "<TR><TD VALIGN=\"TOP\"><img src=\"http://static.userland.com/shortcuts/images/qbullets/movie.gif\" width=\"13\" height=\"11\"></TD><TD VALIGN=\"TOP\" class=\"small\">{itemText()}</TD></TR>", "Digital Photography Review (dpreview.com)", 4, "HST")%>