I used the
Net::XMPP2 Perl module, in particular the
Net::XMPP2::Component class. It uses the
AnyEvent async framework, which in turn support the
EV library , giving you all the love of kernel polling.
Net::XMPP2 author releases a new version, you should use my own copy if you plan on doing external component work (check the component-reply-with-from branch).
Net::XMPP2 is widely used for bots, but not that many components, and some methods need some love to work properly in a component environment.
The HTTP part was done using the excellent
AnyEvent::HTTP class. I'm using my own version, which includes a bug fix to the
http_post function (on its way to release 1.03 of
AnyEvent::HTTP) and adds support for
http_request. I hope to see this included in the main
AnyEvent::HTTP distribution but I still need to update the documentation.
The rest is just glue code.