Talking Social Networks

Ralph Meijer

Mediamatic Lab

Exchanging social objects

Twitter ♥ Jaiku?

Twitter public feed

Pushing Tweets to Jaiku

The moment

XMPP

XMPP publish-subscribe (XEP-0060)

XMPP in FSN


Integrated XMPP, pubsub service

XMPP in FSN


Separate XMPP, pubsub service

Receiving a notification

<message from="ralphm@jaiku.com" to="stpeter@twitter.com">
  <event xmlns="http://jabber.org/protocol/pubsub#event">
    <items node='b4a50f3a-6a85-4c8a-b359-7d41d52c99be'>
      <item id='ab7704b8-cb17-4eab-965c-1f434ef5a95d'>
        ...
      </item>
    <items>
  <event>
<message>

Receiving a Jaiku

<item id='ab7704b8-cb17-4eab-965c-1f434ef5a95d'>
  <entry xmlns='http://www.w3.org/2005/Atom'>
    <title>Explaining talking social networks
           at XTech 2008</title>
    <id>tag:jaiku.com,2006:presence/18111517<id>
    <link>http://ralphm.jaiku.com/presence/18111517</link>
    <updated>2008-05-08T14:58:09+01:00</updated>
  </entry>
</item>

More information

Finding and subscribing

Discovering node information

<iq from='stpeter@twitter.com' to='ralphm@jaiku.com'
    type='get' id='info1'>
  <query xmlns='http://jabber.org/protocol/disco#info'
         node='b4a50f3a-6a85-4c8a-b359-7d41d52c99be'/>
</iq>

Discovery result

<iq from='ralphm@jaiku.com' to='stpeter@twitter.com'
    type='result' id='info1'>
  <query xmlns='http://jabber.org/protocol/disco#info'
         node='b4a50f3a-6a85-4c8a-b359-7d41d52c99be'>
    <identity category='pubsub' type='leaf'/>
    <feature var='http://jabber.org/protocol/pubsub'/>
    <x xmlns='jabber:x:data' type='result'>
      <field var='FORM_TYPE' type='hidden'>
        <value>http://jabber.org/protocol/pubsub#meta-data</value>
      </field>
      <field var='pubsub#type' label='Payload type'>
        <value>http://www.w3.org/2005/Atom</value>
      </field>
      <field var='pubsub#title' label='A short name for the node'>
        <value>Ralph's Jaikus</value>
      </field>
      <field var='pubsub#creation_date' label='Creation date'>
        <value>2003-07-29T22:56Z</value>
      </field>
      <field var='pubsub#creator' label='Node creator'>
        <value>ralphm@jaiku.com</value>
      </field>
      ...
    </x>
  </query>
</iq>

Discovering by JID

The user has entered the JID of the contact directly:

<iq from='stpeter@twitter.com' to='ralphm@jaiku.com'
    type='get' id='info2'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
<iq from='ralphm@jaiku.com to='stpeter@twitter.com'
    type='result' id='info2'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <identity category='account' type='registered'/>
    <identity category='pubsub' type='collection'/>
    ...
  </query>
</iq>

Discovering by JID (cont.)

The user has entered the JID of the contact directly:

<iq from='stpeter@twitter.com' to='ralphm@jaiku.com'
    type='get' id='items1'>
  <query xmlns='http://jabber.org/protocol/disco#items'/>
</iq>
<iq from='ralphm@jaiku.com to='stpeter@twitter.com'
    type='result' id='items1'>
  <query xmlns='http://jabber.org/protocol/disco#items'>
    <item jid='ralphm@jaiku.com'
          node='b4a50f3a-6a85-4c8a-b359-7d41d52c99be'/>
    ...
  </query>
</iq>

Subscribing to a node

<iq from='stpeter@twitter.com' to='ralphm@jaiku.com'
    type='set' id='sub1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <subscribe node='b4a50f3a-6a85-4c8a-b359-7d41d52c99be'
               jid='stpeter@twitter.com'/>
  </pubsub>
</iq>
<iq from='ralphm@jaiku.com' to='stpeter@twitter.com'
    type='result' id='sub1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <subscription node='b4a50f3a-6a85-4c8a-b359-7d41d52c99be'
                  jid='stpeter@twitter.com' subscription='subscribed'/>
  </pubsub>
</iq>

Not authorized (not in roster group)

<iq from='ralphm@jaiku.com' to='stpeter@twitter.com'
    type='error' id='sub1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <subscribe node='b4a50f3a-6a85-4c8a-b359-7d41d52c99be'
               jid='stpeter@twitter.com'/>
  </pubsub>
  <error type='auth'>
    <not-authorized xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
    <not-in-roster-group xmlns='http://jabber.org/protocol/pubsub#errors'/>
  </error>
</iq>

Advanced topics

What if I can't do XMPP?

No XMPP

HTTP Gateway into XMPP Publish-Subscribe

XMPP in anyMeta

XMPP as an API

XMPP as an API

Publishing from a client

<iq from='ralphm@ik.nu/Home' to='ralphm@jaiku.com'
    type='set' id='pub1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <publish node='b4a50f3a-6a85-4c8a-b359-7d41d52c99be'>
      <item>
        ...
      </item>
    </publish>
  </pubsub>
</iq>

XMPP as an API

Publishing from a client

    ...
      <item>
        <entry xmlns='http://www.w3.org/2005/Atom'>
          <title>Explaining talking social networks
                 at XTech 2008</title>
          <id>urn:uuid:ab7704b8-cb17-4eab-965c-1f434ef5a95d<id>
          <updated>2008-05-08T14:58:09+01:00</updated>
        </entry>
      </item>
    ...

Next steps

Thanks

Ralph Meijer


http://ralphm.net/

xmpp:ralphm@ik.nu

mailto:ralphm@ik.nu