Real-time WordPress.com subscription

Going nowhere fastSometimes RSS isn’t fast enough. We’ve been experimenting with faster blog subscription delivery using Jabber to push the messages. When you use Jabber to subscribe to blogs you get the news as soon as it is published. Now almost every post and comment on WordPress.com blogs is published this way and you can subscribe to these streams using almost any Jabber client. Messages are delivered typically within one second of publication. You can also publish to your blogs by typing instant messages. Soon comments will be appearing in Jabber chat rooms.

Let me break it down. Jabber (XMPP) is an instant messaging protocol. There are dozens of free clients (programs) that can connect to Jabber services, thousands of Jabber servers, and millions of daily Jabber users around the world. Even some phones can connect to it, including the iPhone with an appropriate app. So you can probably use Jabber. The primary exception is people behind company or government firewalls that block XMPP ports, but we’ll have a web-based solution for them soon.

Before I give you a link I have to tell you that this service is experimental. If you use it, you are a tester so please wear your white lab coat. A few dozen people have been using it for several months with very few hiccups, but hiccups are still to be expected. Even so, most of us at Automattic rely on it daily to surface and accelerate the discussions on our private blogs. Finally I must tell you that we have not yet worked out all the business angles, so the feature set and limitations may change to accommodate our inevitable need to feed the monkey.

Now I give you im.wordpress.com, which I demonstrated at the CrunchUp last week. Every WordPress.com account is automatically linked to a Jabber account on im.wordpress.com. We have compiled instructions for setting up some popular Jabber clients.

If you want my personal recommendation for a Jabber client, my choice for Mac OS X is Adium. If you already use iChat, just stick with iChat. Some of my coworkers who run Windows have chosen Pidgin. I also sometimes use Psi, which is available for Mac, Windows, and Linux.

Here is some info for people familiar with XMPP. This service is based on XEP-0060 (Publish-Subscribe) acting as a front-end for WordPress blogs. It started as a simple firehose for our commercial partners and grew from there. People subscribing with Jabber clients don’t need Pubsub. They send simple commands to a chat bot and their items are delivered as XHTML-IM from the blog’s URL. The bot speaks XEP-0060 on their behalf. If you can speak XEP-0060, you can connect to pubsub.im.wordpress.com and subscribe to nodes. The nodes for this blog are /blogs/andy.wordpress.com/ for posts, /blogs/andy.wordpress.com/comments/ for all comments, and /blogs/andy.wordpress.com/2009/07/16/real-time-wordpress-com-subscription/ for comments on this post. Node discovery and item discovery and retrieval are not implemented. Reasonable subscription and traffic limits will be imposed. If you are looking for a complete feed of all our blogs and comments, try the firehose.

25 Comments

  1. Arnab Das

     /  July 16, 2009

    too much pain. Creating an account etc. But would love to give it a try if a stable release comes out. Using feedreader as of now. Its not at all what u’d call realtime feed updates, but it gets updated around 3-4 hours after a post is made. which is quite okay for me.

    • You don’t already have a WordPress.com account? That’s a shame. Anyway, we are working on ways to make this accessible for other Jabber accounts, including Google Talk.

  2. Pidgin is available for Linux as well as Windows. I believe Adium is based upon the same messaging library as Pidgin, the main difference being that until recently, they viewed IRC as an unholy feature which would not be supported.

    But yeah, basically, Pidgin is fantastic, but in Mac land it is called Adium.

    Sincerely,
    -daniel

  3. What are you using for the XMPP server? Do you think you’ll be releasing whatever code of yours would let us integrate a XMPP server with our standalone WP sites?

    Any plans to enable the publish part of XEP-0060 for comments and posts?

    • Ejabberd. I am not sure how many of the custom modules I will distribute. I definitely want to allow self-hosted WordPress blogs (really anything with an Atom feed) to efficiently and securely publish items in our Pubsub service.

      I do plan to enable XEP-0060 publishing for posts and comments.

  4. Thank you for this. I’ve been waiting for this announcement for months :-) With this and P2, it’s remarkable how what was once a blog, can now be an effective and versatile real time communication tool. What are your plans for self-hosted users? Will there be a GPL plugin? I run both an ejabberd server and WPMU at work. Will it be straightforward to bring them together with a plugin based on your code, if released? It would be interesting to hear your thoughts on the server to server use of this, too. Can you give any examples where XMPP PubSub might be used to federate communication between WordPress instances? Other than the firehose use, I’m struggling with how the S2S side of this might be fully exploited, though something tells me that this is where your work gets really interesting. :-)

    • We use this most often with P2. I also have a version of P2 that connects the browser to XMPP via BOSH and subscribes to posts and comments. It receives updates with less delay than the current AJAX polling. It’s very easy to do this with SASL anonymous. I also have an ejabberd module that prepares a BOSH session for logged-in users so they aren’t anonymous. This needs more work to ensure subscriptions are dropped when the BOSH session closes.

      The WordPress MU plugin is very simple. It formats the post/comment as an Atom item and delivers that via basic authenticated POST to a hacked Ejabberd module called atom_pubsub. One easy HTTP request, zero XMPP in PHP. The Atom templates are copypasta from WordPress. The auth string is hard-coded. You could clone it in a few hours.

      I haven’t thought of any worthy use cases for S2S between separately hosted blogs. I think the only reason you would need your own XMPP server would be to ensure privacy, in which case I don’t see any reason for traffic with other XMPP servers.

  5. Cool stuff, just tried this out on Monday.

  6. kael

     /  July 19, 2009

    How about adding support for XEP-0240: Auto-Discovery of JabberIDs on every WP blog to ease subscription, similar to this page (Ctrl+U) ?

  7. kael

     /  July 20, 2009

    I’d have another suggestion.

    The WP XMPP server or bot could (auto-)subscribe to PEP user messages stream (tune, mood, geolocation, activity, etc.) which would be displayed on WP blogs in a side column for example.

  8. This is great! I’d been looking for additional public services that support PubSub.

    I wrote up a quick tutorial on using Switchboard to subscribe to and consume WordPress.com feeds: http://mojodna.net/2009/07/21/subscribing-to-wordpress-com-with-switchboard.html

    Once I get some sample output, I’ll update it with some Ruby consumer code.

  9. mojodna

     /  July 23, 2009

    Also, how long does it take for nodes corresponding to new blogs to become available? When I attempt to subscribe to /blogs/newblog.wordpress.com, the subscription request times out.

  10. Jacob

     /  October 28, 2009

    Cool! Will try now with this very comment. :)

  11. Great! How does the robot work? We’d like to set up a robot that handles subscriptions and sends subscribed events to subscribers via Jabber (e.g. to support non-PubSub clients).

    • When I wrote this post, the robot worked by creating Pubsub subscriptions on behalf of the user. So you would tell the robot “sub andy.wordpress.com” and it would create a subscription for the JID user@im.wordpress.com/bot@im.wordpress.com. See how the bot’s JID is the resource? The bot is really a packet filter. So it would intercept messages from pubsub.im.wordpress.com, inspect the recipient JID’s resource, reformat and reroute the pubsub event as a chat message.

      Now, the robot is still implemented as a packet filter. It receives anything destined for its JID and runs the message through a PHP function. This works better for us because now we can easily interface with the WordPress.com databases. It’s also easier to write and deploy bot behaviors (lots of text processing) in PHP than in Erlang.

      Maybe I’ll clean up and release the bot code. It’s not very complex now.

      • This would be great! I’m very very interested in the code…

  12. That’s cool, but I wonder what server program you are using, is it ejabberd?

  1. Peter Saint-Andre (stpeter) 's status on Wednesday, 15-Jul-09 22:04:15 UTC - Identi.ca
  2. Suscripción a blogs en tiempo real por IM | Ayuda WordPress
  3. The JISCPress Prototype Demonstrator Platform « JISCPress
Follow

Get every new post delivered to your Inbox.

Join 1,667 other followers

%d bloggers like this: