Archive for the 'Programmation' Category

25th juin 2008

Jabber Feed v0.2 released: Jabber publication plugin for Wordpress

The second release of Jabber Feed is out today. It has been greatly improved though I will still have some work on it. Now all nodes are created automatically by the plugin when you configure it. Hence it will “tell” you if your Jabber account is wrong or if you don’t have the rights to create the node.

The posts will be published to a subnode ‘posts‘. So people can subscribe to this node in order to receive only notifications about new posts.
Comments are published under the subnode ‘comments/{id}‘ where ‘{id}’ is to be replaced by the post’s id. Hence people can subscribe to the comments of a single post. By subscribing to ‘comments’ node only, you will receive all comments, as long as the correct option to receive items of subnodes as well is set (unfortunately this option is not understood by ejabberd, the server which I made tests with, and the one of jabber.org. I don’t know for the other server softwares) in your subscription.

Of course we cannot ask people to “know” all this. This is why autodiscovery links are automatically set on every pages (you can subscribe to comments on a specific post only, to all posts, all comments, etc.). I also provide 2 templates to generate these links (either autodiscovery links for html header, or just simple ‘a’ tags, or even just bare XMPP urls) in order for you to use them as you like in your theme. For instance, I added a ‘a’ link to the post and comment nodes at the bottom of my test page, and a ‘a’ link above the comments for subscribing to comments of a post.

One of the other main points I improved since first version is that now, all nodes are created automatically for you! The blog admin don’t need to do anything, he doesn’t have to know XMPP and how it works. She or he simply has to know a pubsub server and choose an unchosen node on it.
You can also have a look at the improved configuration page which creates the nodes and tests the Jabber login (JID) when you aknowledge the configuration with the “Update” button.

To conclude this all, I will say that I am pretty happy of this all. This is still not perfect. Some details have to be improved, or even fixed (I keep a todo list you can read in the wordpress repository). But this is a nice step since first version and soon technically close to perfection from a publishing system point of view. :p Now I will work on higher priority on the syntax of the sent message because it is really ugly (and without content processing, it will probably fail with some special html character or tags). I especially want to process the posts and the comments’ content to make them XHTML-IM compliant before sending it. Note that I will probably provide this new version very soon (in a week, if my mind don’t get disturbed by other stuffs).

More information, as well as the plugin itself, are foundable on the Wordpress repository website.

Any feedback is more than welcome. :-)

P.S.: note that I don’t even use the plugin here (in fact yes, I enabled it but don’t show it by using the templates in my theme!) because ejabberd (the server software I use, and one of the most famous. For instance jabber.org also uses it) has a big bug on the pubsub implementation which prevents from creating and especially subscribing to a node from a JID of another server! So this is not a useful PubSub implementation if people cannot subscribe (or only people on the same server as you, which is a huuuuge limitation).
Yet I was told Tigase has currently a very good pubsub implementation (close to 100%). So I will make some tests soon (but first I have to install it, unless someone can forward me to one where I can run tests to spare time?) with it and maybe change my server for Tigase if it is really better.

Posted in Jabber/xmpp, Programmation, en | 1 Comment »

01st avr 2008

More than just Instant Messaging: publication and notification using Jabber/XMPP

Jabber (also called XMPP, as a protocol standardized l’IETF) is well known for being “just” an instant messaging system (and network) which can be compared to ICQ, Yahoo!, Live Messenger, AIM, Gadu-Gadu or others. But it is in fact far more. As a very young protocol for real-time communication, new features are continuously imagined, developped and improved. One of these features can be very interesting and may prove to have a nice future, in my own opinion: this is the “Publish-Subscribe” (abbreviated into pubsub).

As the name implies, this system enables users with a role of “publishers” and others as “subscribers”. Hence the publishers will obviously “publish” information on a Jabber node (with is simply a term defining some kind of Jabber address), whereas the subscribers will have the possibility to read this information, and configure their subscription according to their needs. For instance a common use would be to ask being notified when new information is added. This last use case gave me the idea to developp a small plugin for Wordpress (the publishing system used for this website), which I called: Jabber Feed.

Image de publication des Marmottages
Jabber Feed will enable readers of this website for instance to subscribe to a Jabber node, then asking to be notified in realtime of every new post, or even comment. People could compare this to RSS feed, though Jabber Feed has many advantages: it is realtime, it spares bandwith, and it can be highly customizable.

Yet the main big problem is that it is hardly supported currently by most Jabber clients (even the more advanced ones; for pubsub, Gajim being the better I have tried), and by servers but with many lacks of the full protocol (as far as I have tried at least). Thus my plugin is rather a Proof of Concept as for now. Anyway I will regularly improve it and update news on this development here. Hopefully soon more clients will have a better support. I created also a permanent page about it here and the code can be foundable on the official Wordpress’ plugin repository).

I will give later a node for my public diary (the one you are reading!) because someone noticed it is apparently unsubscribable from an exterior address and I have no time to look how to configure my server as I am leaving for 2 weeks of hollydays in Japan in a few hours.
So see you then!

Edit: here is the notification I received in Gajim (last subversion). This is not much, it does not support full content currently, but it is the only client (among the ones I have tested) which notified me at least!
Notification in Gajim

Posted in Jabber/xmpp, Programmation, en | 1 Comment »

28th mar 2008

Jabber est plus qu’un réseau de messagerie instantanée: publication et notification

Dans mes précédents articles sur Jabber, je l’ai comparé aux divers réseaux fermés de messagerie instantanée. Que l’on parle de l’ancêtre ICQ, des dominants Yahoo!, Live Messenger ou AIM, de l’incongru (ou plutôt local) Gadu-Gadu ou simplement de notre étoile montante Jabber (sous toutes ses formes, comme celle qu’elle prend avec GoogleTalk), on pense immédiatement et uniquement à des systèmes de discussion en temps réel. Pourtant ce n’est qu’une des multiples facettes de Jabber, celle qui a montré son visage en premier certes, car elle s’est engouffrée dans une mode. Mais Jabber (ou XMPP, nom standardisé par l’IETF) est en fait un protocole bien plus généraliste avec énormément de possibilités (on pourrait presque dire une infinité), lesquelles sont en permanence travaillées par la Fondation Jabber. C’est un protocole jeune et mouvant, ce qui est à la foi son point faible actuel, car il bouge un peu trop vite et rend obsolète certaines implémentations en peu de temps, et son point fort car son évolution rapide donne de plus en plus de possibilités.

Ce billet ne traitera que d’une des fonctionnalités de XMPP — le Publish-Subscribe — que j’ai “traduit” par un programme adapté à ce site. J’ai appelé ce programme: Jabber Feed.

Publish-Subscribe” (”Publier-Souscrire” en français, aussi connu sous l’abbréviation “pubsub”) est un système conceptualisant des nœuds de publication , service permettant de publier des données d’un côté; et de l’autre côté, des “utilisateurs” peuvent s’abonner à ces même nœuds et configurer les détails de leur inscription, par exemple en demandant à être notifiés quand quelque chose de nouveau survient. Ce principe a de multiples débouchés. Je pense que vous pourrez tous penser à au moins une utilisation que l’on peut en faire.
Image de publication des Marmottages
J’ai décidé d’appliquer ce concept à une utilisation précise la semaine dernière en développant un plugin pour Wordpress (le système de publication utilisé pour ce journal) afin de publier l’ensemble des articles que j’y fais en temps réel sur un nœud Jabber. Un lecteur régulier pourra par conséquent s’y inscrire et recevra les nouveaux articles par Jabber sans avoir à régulièrement visiter ce site. Cela permet d’éviter d’avoir à vérifier régulièrement l’existence de nouveautés (ça tombe bien car j’écris peu souvent, donc si vous deviez venir souvent, ça serait inutile; et si vous ne veniez jamais, vous oublieriez ce site).

Évidemment le gros problème — car il y en a un — est que peu de clients Jabber ont à l’heure actuelle un bon support, sinon aucun, de cette partie du protocole Jabber. Il y a donc peu de chances que vous puissiez tester mon plugin dans l’immédiat en tant qu’utilisateur (il y a cependant des méthodes de contournement dont je peux parler, mais un peu compliquées et qui ne servent que dans un but de test). Pour l’instant il s’agit donc d’une “Démonstration Conceptuelle” qui, espérons le, va faire partie d’un début pour accélérer les implémentations.
En tous les cas, sachez que je tiendrai régulièrement au courant des nouveautés autour de ce plugin (j’ai créé une nouvelle page permanente sur mon havre pour lui ici et héberge le code pour installer le plugin sur le dépôt officiel des plugins Wordpress), ainsi que des technologies associées.

Néanmoins si vous connaissez suffisamment le protocole, vous pouvez vous inscrire sur le nœud ‘home/zemarmot.net/jehan/blog/posts‘ pour recevoir automatiquement les nouveaux billets et sur ‘home/zemarmot.net/jehan/blog/comments‘ pour les commentaires, le tout sur le serveur pubsub.zemarmot.net.

Posted in Jabber/xmpp, Programmation | 21 Comments »