Federated Social Networks

Ralph Meijer

XMPP Standards Foundation

Ralph Meijer

Exchanging social objects

XMPP

XMPP publish-subscribe (XEP-0060)

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 federated social networks
           at Web 2.0 Expo Berlin</title>
    <id>tag:jaiku.com,2006:presence/18111517<id>
    <link>http://ralphm.jaiku.com/presence/18111517</link>
    <updated>2007-11-07T11:28: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

Beyond

Thanks

Ralph Meijer


http://ralphm.net/

xmpp:ralphm@ik.nu

mailto:ralphm@ik.nu