I’ve just finished a first version of a simple news headline tag for
Radiant, incorporated into a ‘News’ behavior. It parses an RSS feed from
a given feed URL and generates an unordered list of headline items. The
number of headlines and whether or not a published date gets appended
can be configured through attributes. The behavior has been tested with
the main article XML feed from a Typo 2.6.0 blog, an RForum 0.2 all
forums post feed and a Collaboa 0.5.6 installation’s ticket feed.
Example:
<r:news feed = “http://mydomain.org/articles.xml”
headlines = “3”
dates = “1” />
Leads to something like:
- First news item (01-Aug-2006)
- Next headline (28-Jul-2006)
- Final RSS item title (19-Jul-2006)
The code requires the simple-rss gem. Unfortunately this does not work
with SlashDot’s news feed - the RSS parser doesn’t seem to understand
it. RSS issues aside, it may have been better to have created tags that
expressed the RSS contents directly and so provide greater content
flexibility, though this would increase complexity for the user
considerably. The existing behavior meets my immediate requirements, but
if I find some spare time I may look into making a more generic RSS
behavior too.