<?xml version='1.0' encoding='utf-8'?>
<?xml-stylesheet href="/style/browser.xsl" type="text/xsl"?>
<essay xmlns="http://docbook.org/ns/docbook"
       xmlns:xlink="http://www.w3.org/1999/xlink"
       xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
       xmlns:dc='http://purl.org/dc/elements/1.1/'
       xmlns:dcterms="http://purl.org/dc/terms/"
       xmlns:gal='http://norman.walsh.name/rdf/gallery#'
       xmlns:foaf="http://xmlns.com/foaf/0.1/"
       xml:lang="en"
       version='5.0'>
<info>
<title>Mojo</title>
<volumenum>10</volumenum>
<issuenum>112</issuenum>
<pubdate>2007-10-18T16:44:14-04:00</pubdate>
<date>$Date$</date>
<author><personname>
<firstname>Norman</firstname><surname>Walsh</surname>
</personname></author>
<copyright><year>2007</year><holder>Norman Walsh</holder></copyright>
<abstract>
<para>Getting your telephone mojo on. [Updated: new pipeline.]</para>
</abstract>
</info>

<para xml:id='p1'>The other day, <foaf:name role="fullname">Paul Downey</foaf:name>
offered me a login on his
mostly stealth-mode project, <link xlink:href="http://mojo.bt.com/"/>.
(I'm not outing them, or if I am, it's Paul's fault, he said it was
ok to blog about it. :-)
</para>

<para xml:id='p2'>Paul is a pretty consistent source of interesting stuff and good
ideas, so I was delighted to take his new jalopy out for a spin. After
logging in, I get this screen:</para>

<mediaobject role="flickr"><!--Mojo-->
  <imageobject xlink:href="http://www.flickr.com/photos/ndw/1621966566/">
    <imagedata fileref="http://farm3.static.flickr.com/2154/1621966566_50855444b3.jpg"/>
  </imageobject>
</mediaobject>

<para xml:id='p3'>A bit of random clicking reveals that there's a fair bit of
documentation about the APIs (more on those in a bit), but not
much description of what this service <emphasis>actually
does</emphasis>.</para>

<para xml:id='p4'>The “text message” bit seems fairly straightforward; I plonk in
my mobile number and a message, click “send”, and a few seconds later
my phone buzzes on my desk and half scares me to death. “Hello world”
it says. Just what I typed.</para>

<para xml:id='p5'>Now “phone call”. Phone call?</para>

<para xml:id='p6'>I can see only one obvious interpretation, so I plonk in my work
number, my home number, and click “make call”. A few seconds later, my
phones ring and I'm connected to myself (by way of <wikipedia
page="BT_Group">BT</wikipedia>, I assume; not the most efficient way
to connect two phones on the same desk on this side of the pond,
<emphasis>but it worked</emphasis>).</para>

<para xml:id='p7'>It worked!</para>

<para xml:id='p8'>I have no rational explanation for why this made me laugh
gleefully for several minutes while
<wikipedia>Pinky and the Brain</wikipedia> drifted through my mind.
World domination by
way of web service? It's not astonishingly new technology. There are
teleconference bridges that will call out. You can even get the W3C's
bridge to do it <link
xlink:href="http://www.w3.org/2001/12/zakim-irc-bot.html">via
IRC</link>.</para>

<para xml:id='p9'>So I don't know why it made me laugh, but it did.</para>

<para xml:id='p10'>By itself, a web page that lets you send SMS messages or make phone
calls isn't really all that exciting. What makes the Mojo stuff cool is
that it's all accessible with
<wikipedia page="Representational_State_Transfer">RESTful</wikipedia> web
APIs. If you can drive an <code>http:</code> connection, you can send
messages and make calls.</para>

<para xml:id='p11'>That's a pretty interesting bit of infrastructure. And because
it's all open, there's the real possibility of some unexpected
applications. Good on BT!</para>

<para xml:id='p12'>One of the things you can do with your login is create your own
“gadget”. So here's the obvious one for me to make, an
<link xlink:href="examples/mojo.xpl">XProc Gadget Pipeline</link>.</para>

<para xml:id='p13'>Using this pipeline, I can send an SMS like this:</para>

<programlisting><![CDATA[<px:mojo-sms xmlns:px="http://xproc.org/ns/xproc/ex"
	     username="ndw" to="+15555551234" text="My message"
	     secret="my-secret-mojo-key"/>]]></programlisting>
	     
<para xml:id='p14'>The pipeline I originally posted didn't work, in fact
wasn't valid, but I've updated it (19 Oct 2007) and now it
<emphasis>actually works!</emphasis> I'm laughing gleefully again, but
the explanation is pretty obvious!</para>

<para xml:id='p15'>Pretty cool stuff, I think. And it feels pretty cool to be writing
pipelines that actually <emphasis>do something new</emphasis>.
We'll ignore the fact that this one required three
extension steps: <tag>px:sha1</tag>, <tag>px:uuid</tag>, and
<tag>px:url-form-encode</tag>. No, not ignore, it's a productive
use case!</para>

<para xml:id='p16'>Thanks, Paul! And good luck with your mojo!</para>

</essay>
