An RSS News Agent

While the Jabber clients available off the shelf are orientated toward receiving (and sending) messages from other people, the possibilities don’t stop there, as is clear from the recipes we’ve seen already. In this recipe, we’re going to build a Jabber component that retrieves news items from various sources on the Web and sends them on to Jabber users who have expressed an interest in receiving them. We’re going to use the Web for our news sources, but they could just as easily be sources within a corporate intranet. The key thing is that the sources are available in a readily parseable format.

RSS (RDF[5] Site Summary or, alternatively, Really Simple Syndication) is an XML format used for describing the content of a web site, where that site typically contains news items, diary entries, event information, or generally anything that grows, item by item, over time. A classic application of RSS is to describe a news site such as JabberCentral (http://www.jabbercentral.org). JabberCentral’s main page (see Figure 9-5) consists of a number of news items—in the “Recent News” section—about Jabber and its developer community. These items appear in reverse chronological order, and each one is succinct, sharing a common set of properties:

Title

Each item has a title (“JabberCon Update 11:45am - Aug 20”).

Short description

Each item contains a short piece of text describing the content and context of the news story (“JabberCon Update - Monday Morning”).

Link to main ...

Get Programming Jabber now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.