At this stage, we've got a good idea of how scripts interact with Jabber, and how the core elements such as <message/> and <presence/> can be constructed and handled.
This Chapter builds upon what we've already seen in the previous one, and introduces new concepts. We build a nosey assistant that joins a conference room and alerts us to words and phrases that we want it to listen for. There are two popular conference protocols; the assistant recipe, a foray into the world of 'bots, takes a look at the original presence-based one. [1]
Programming within Jabber's event model is, as we've seen, straightforward. What happens when you want to meld other components with event models of their own? We look at a couple of typical scenarios where this melding needs to happen. The first is a homage to the Trojan Room Coffee Machine, [2] where we give life, or at least presence, to a coffee pot, using LEGO Mindstorms. The second is an RSS headline viewer that uses Tk, which has an event loop of its own.
We also look at extending messages, and build a mechanism that "punts" RSS headlines to clients who register with that mechanism. These headlines are carried using an extended message type.
In fact, the RSS punter mechanism is a component. The three recipes in the previous Chapter were Jabber clients, in that they connected to the Jabber network via the JSM (Jabber Session Manager) service. We look at the differences between programming a client and programming a component in this Chapter, and build a complete component that can be queried and interacted with the third of Jabber's building blocks—the <iq/> element.
Happy coding!
| [1] | The other uses the jabber:iq:conference namespace described in the section called jabber:iq:conference in Chapter 5a. |
| [2] | Famously the first "device" to be reachable over the Web, at http://www.cl.cam.ac.uk/coffee/coffee.html. |