A Simple Headline Viewer

Let’s close this chapter on a lighter note by building a complementary script that we can use to keep an eye on the headlines coming in from the RSS news agent. We’ll call this program hlv, for “HeadLine Viewer.” Basically, we want to build something that allows the user to watch RSS headlines as they scroll by in a window that doesn’t take up a lot of screen real estate.

In the recipes so far, we’ve had great success building solutions that make use of off-the-shelf clients. But it’s time to buck the trend, indeed to make another point. While you can arrange the features of your Jabber-based applications in the direction of standard clients, to take advantage of the installed base of Jabber clients, if you do want to create a client that works differently, a client that fits your needs exactly, then go ahead—it will be surprisingly straightforward. The mantra of “server side complex, client side simple” (with apologies to George Orwell) is there to help us. What’s more, we can put into action an idea expressed earlier in the book (in Section 2.7):

A Jabber client is a piece of software that implements as much of the Jabber protocol as required to get the job done.

If we’re going to build a headline viewer client and know that the information is going to be delivered to us in headline-type <message/> elements, why have the viewer client understand or deal with anything else? To implement a Jabber solution, we pick and choose the parts of the protocol ...

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.