Re: jabber bot for monitoring a machineby kirillm (Friar)
|on Jan 07, 2008 at 13:26 UTC||Need Help??|
A comment about POE::Component::Jabber.
POE::Component::Jabber is in my opinion very good. The way version 1 handled network connections was a bit buggy, but version 2 is huge step forward and is really great.
POE::Component::Jabber gives you a flexible framework to build your XMPP client, but you will need to do a lot yourself. You are required to have read at least RFC3920 and RFC3921. In that reagrd, the documentation is very good.
For example to send a message you'd first create a POE::Filter::XML::Node object and then pass it to the output_handler event. Here's an example of how I send messages (send_message is my own event handler, but it sends to output_handler in it's last line):
To receive messages (and other input) in your XMPP client you'd create your own event handler. It will receive a POE::Filter::XML::Node object that you can do whatever you want with. Example from my code:
The above code does not handle incoming messags (since I wasn't interested in these), but read the mentioned RFC and you'll see what you'll need.