ralphm's blog

Friday, 21 October 2005

BarCamp Amsterdam (2)

Pinky, what are we doing today?

Ok, so there we are, in the middle of the night. Although it was pretty crowded when we got here, most people have either gone home or to the hotel they spend the rest of this week's nights in already. A dozen people remains, of which a number of nice Drupal guys. Of course we are planning World Domination™ through our combined non-erlang platform. Details to follow.

Thursday, 20 October 2005

BarCamp Amsterdam

Meet, network, learn, and teach...

To supplement the EuroOSCON, BarCamp Amsterdam will take place from today 16:00 until tomorrow 23:59. Basically a bunch of open source and technology projects meeting up. As the organisers asked to have people from the Jabber community present, away intosi and xa I will be attending this great initiative.

To get right into it and promote our community, I had us made two t-shirts. The design was done using Inkscape. They came out pretty nice, I must say. Thanks to Usher Lieberman for inspiration.

Provided there's some connectivity, there'll be live updates in this space. Photo's here. Stay tuned.

Monday, 17 October 2005

Twisted Virtual Sprint results

The aftermath...

A I mentioned last week, the Twisted crowd held its first Twisted Virtual Sprint. I believe many made progress, so I'd say it was a success. Personally, I managed to finalize the reworking of Xish and the Jabber stuff in Words as a precursor to implement full XMPP support.

For months I had been sporadically working on this, and I'm happy to say that I finally committed it to Trunk. The Jabber part of Words got its own xmlstream module that builds on the stripped xmlstream in Xish. I also added a lot of docstrings to the code I touched, so people might have more clue on how to use it.

I also decided to gather the people actually using these modules by setting up a new mailinglist: Twisted-Jabber. The initial set of people includes the authors of the projects pyMSNt, pyAIMt, pyICQt, PunJab and Twibber. If I somehow forgot to invite you or your project, consider this your invitation. It seems pretty constructive already, so that's pretty nice.

In the coming period, I hope to finish a pure-XMPP client authenticator using TLS and SASL, along with some wrapper that can also use old-skool jabber:iq:auth authentication when connecting to pre-XMPP 1.0 servers. Some people have pointed me towards a sslverify module in Divmod's repository, for certificate verification.

Furthermore, I will add support for creating XML stanzas somewhat easier, like the IQ class in twisted.words.protocols.jabber.client, along with a sendDeferred method that returns a deferred that fires when a reply has been received. Received error replies will be converted to exceptions that can be trapped. Also, sending back errors will become somewhat easier.

Next on the list is server-to-server functionality. This requires handling incoming connections, which also comes in handy for implementing services that handle incoming component and client connections. A small server implementation shouldn't be too far off then.

We'll see how this works out, but I'll report progress over here.

Saturday, 8 October 2005

Twisted Virtual Sprint

Hacking away...

After a number of succesful Australian sprints, this weekend people gather for the first, experimental, Twisted Virtual Sprint. Anyone interested in helping out improving the code and/or documentation is welcome to participate by joining the #twisted IRC channel on irc.freenode.org.

As maintainer of the Streaming XML bits in Twisted (including Jabber support), I've committed to work on removing the last Jabber-specific stuff in Xish' xmlstream module, making it generically usable for any kind of streaming XML. The code that is taken out will be moved to Twisted Words. The plan is to make the Jabber support in Words XMPP compliant. For example, it should support stream features like SASL and TLS, gain an idea of the three XML Stanzas and also properly handle stream level and stanza level errors. I've started on this a while back already, putting my code in my personal branch in Twisted's SVN repository.

So, what do you use a generic Streaming XML module for. Streaming XML is basically opening a socket and exchanging first-level elements (direct childs of the root element that we call stanzas) during the lifetime of the connection. An example use is handling FeedMesh streams. The concept of FeedMesh is sharing pings of updated blogs between entities like PubSub.com and blo.gs. Monitoring this stream can be as simple as the following snippet:

from twisted.xish import xmlstream
from twisted.internet import reactor

def onPing(element):
    print "Ping for %s" % (element["rss"])

def connected(xs):
    print "Connected!"
    xs.addObserver('/weblog', onPing)

f = xmlstream.XmlStreamFactory()
f.addBootstrap(xmlstream.STREAM_START_EVENT, connected)

reactor.connectTCP('sandbox.pubsub.com', 9999, f)
reactor.run()

This opens a connection to PubSub.com's experimental service. When stream has been started (the client will receive a root element), the STREAM_START_EVENT event is dispatched. The function connected will be called with the actual XmlStream object. This function sets up a new handler based on an XPath-like expression. In this case, we want to monitor weblog stanzas. The onPing function will be called for each matching element, passing the object representing the element. The element's attributes are available as items of the object.


Note:

The FeedMesh services have varying terms of service. Currently, they are at most experimental and you should not use them for updating feeds in a (desktop) feed reader, unless the service operator specifically allows this.