1
0
mirror of https://github.com/moparisthebest/xeps synced 2024-11-13 21:05:09 -05:00
xeps/xep-0277.xml

212 lines
12 KiB
XML
Raw Normal View History

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM 'xep.ent'>
%ents;
]>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep>
<header>
<title>Microblogging over XMPP</title>
<abstract>This specification defines a method for microblogging over XMPP.</abstract>
&LEGALNOTICE;
<number>0277</number>
<status>Experimental</status>
<type>Standards Track</type>
<sig>None</sig>
<approver>Council</approver>
<dependencies/>
<supersedes/>
<supersededby/>
<shortname>NOT YET ASSIGNED</shortname>
&stpeter;
&hildjj;
<revision>
<version>0.1</version>
<date>2010-01-27</date>
<initials>psa</initials>
<remark><p>Initial version as accepted for publication by the XMPP Council.</p></remark>
</revision>
<revision>
<version>0.0.1</version>
<date>2008-05-07</date>
<initials>psa/jh</initials>
<remark><p>First draft.</p></remark>
</revision>
</header>
<section1 topic='Introduction' anchor='intro'>
<p>Microblogging is an increasingly popular technology for lightweight interaction over the Internet. It differs from traditional blogging in that:</p>
<ul>
<li>Posts are short (typically less than 140 characters, which is the limit in SMS).</li>
<li>Posts are in plain text.</li>
<li>People can reply to your posts, but not directly comment on them.</li>
<li>People learn about your posts only if they have permission to view them.</li>
<li>Your microblogging feed is discovered based on your identity at a domain or with a service.</li>
</ul>
<p>These characteristics map well to instant messaging systems such as those built using Jabber/XMPP technologies (e.g., permissions can be based on existing presence subscriptions as reflected in the XMPP roster or "buddy list"). Furthermore, the push nature of XMPP (especially as formalized in the &xep0163; profile of &xep0060; overcomes the problems of polling for updates via HTTP, which has caused scaling issues in existing microblogging services. Therefore this specification defines a method for microblogging over XMPP, building on the existing method for transporting Atom syndication data &rfc4287; over XMPP as described in &atomsub;. These XMPP-based methods are complementary to HTTP-based methods, and can provide an XMPP interface to existing microblogging services (which may also be accessible via HTTP, Short Message Service (SMS), and other message transports).</p>
</section1>
<section1 topic='Protocol' anchor='proto'>
<section2 topic='Location' anchor='location'>
<p>A person's microblog SHOULD be located at a personal eventing (PEP) node whose name is "urn:xmpp:microblog:0" but MAY be located at a generic publish-subscribe node that is not attached to a user's IM account. For instance, if the Shakespearean character Romeo has a JabberID of &lt;romeo@montague.lit&gt; then his microblog would be located at that JID with a node of "urn:xmpp:microblog:0". Outside of native XMPP systems, this node can be referred to as the following XMPP URI (the ":" character from the namespace URN is percent-encoded in the query component; see &rfc5122; and &rfc3986;).</p>
<code><![CDATA[
xmpp:romeo@montague.lit?;node=urn%3Axmpp%3Atmp%3Amicroblog
]]></code>
<p>Naturally, this node can be discovered by contacting romeo@montague.lit directly using &xep0030;.</p>
</section2>
<section2 topic='Subscribing to a Microblog' anchor='subscribe'>
<p>Let us imagine that Juliet wishes to receive the posts that Romeo publishes to his microblog. She has two options:</p>
<ol>
<li>Implicitly subscribe by advertising support for "urn:xmpp:microblog:0+notify" in her &xep0115; data. Romeo's PEP service then automatically sends posts to her when it receives presence from her, until and unless she sends presence of type unavailable or stops advertising an interest in microblog updates.</li>
<li>Explicitly subscribe by sending a formal subscription request to the "urn:xmpp:microblog:0" node at Romeo's JabberID. Romeo's PEP service may send her all posts even if she is offline at the time (depending on service policies regarding presence integration).</li>
</ol>
</section2>
<section2 topic='Publishing a Post' anchor='publish'>
<p>Romeo can publish a post via any interface provided by his service, such as a website, the Atom Publishing Protocol (see &rfc5023;), SMS, an IM bot, or XMPP pubsub. Here we assume that the post is provided via XMPP pubsub.</p>
<p>Note: Publishing via HTTP, AtomPub, SMS, or IM bot is simpler for the client (e.g., because the client does not need to generate an Item ID).</p>
<example caption="Publishing a post"><![CDATA[
<iq from='romeo@montague.lit/pda'
id='pub1'
to='romeo@montague.lit'
type='set'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='urn:xmpp:microblog:0'>
<item id='1cb57d9c-1c46-11dd-838c-001143d5d5db'>
<entry xmlns='http://www.w3.org/2005/Atom'>
<source>
<title>Romeo&amp;apos;s Microblog</title>
<link href='http://montague.lit/romeo'/>
<id>tag:montague.lit,2008:home</id>
<updated>2008-05-08T18:30:02Z</updated>
<author>
<name>Romeo Montague</name>
</author>
</source>
<title>hanging out at the Caf&amp;#233; Napolitano</title>
<link rel='alternate'
type='text/html'
href='http://montague.lit/romeo/posts/1cb57d9c-1c46-11dd-838c-001143d5d5db'/>
<link rel='alternate'
href='xmpp:romeo@montague.lit?;node=urn%3Axmpp%3Atmp%3Amicroblog;item=1cb57d9c-1c46-11dd-838c-001143d5d5db'/>
<id>tag:montague.lit,2008-05-08T18:30:02Z:posts-1cb57d9c-1c46-11dd-838c-001143d5d5db</id>
<published>2008-05-08T18:30:02Z</published>
<updated>2008-05-08T18:30:02Z</updated>
</entry>
</item>
</publish>
</pubsub>
</iq>
]]></example>
</section2>
<section2 topic='Receiving a Post' anchor='receive'>
<p>Because Juliet has sent presence to Romeo including Entity Capabilities data that encapsulates the "urn:xmpp:microblog:0+notify" feature, Romeo's XMPP server will send a PEP notification to Juliet. The notification can include an XMPP message body for backwards-compatibility with Jabber clients that are not pubsub-capable (see <a href="#body">Message Body</a>).</p>
<example caption="Receiving a post"><![CDATA[
<message from='romeo@montague.lit'
to='juliet@capulet.lit'
type='headline'>
<body>hanging out at the Caf&amp;#233; Napolitano</body>
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<items node='urn:xmpp:microblog:0'>
<item id='1cb57d9c-1c46-11dd-838c-001143d5d5db'>
<entry xmlns='http://www.w3.org/2005/Atom'>
<source>
<title>Romeo&amp;apos;s Microblog</title>
<link href='http://montague.lit/romeo'/>
<id>tag:montague.lit,2008:home</id>
<updated>2008-05-08T18:30:02Z</updated>
<author>
<name>Romeo Montague</name>
</author>
</source>
<title>hanging out at the Caf&amp;#233; Napolitano</title>
<link rel='alternate'
type='text/html'
href='http://montague.lit/romeo/posts/1cb57d9c-1c46-11dd-838c-001143d5d5db'/>
<link rel='alternate'
href='xmpp:romeo@montague.lit?;node=urn%3Axmpp%3Atmp%3Amicroblog;item=1cb57d9c-1c46-11dd-838c-001143d5d5db'/>
<id>tag:montague.lit,2008-05-08T18:30:02Z:posts-1cb57d9c-1c46-11dd-838c-001143d5d5db</id>
<published>2008-05-08T18:30:02Z</published>
<updated>2008-05-08T18:30:02Z</updated>
</entry>
</item>
</items>
</event>
</message>
]]></example>
</section2>
<section2 topic='Replying to a Post' anchor='reply'>
<p>Anyone can publish a post in reply to Romeo's post. Here we assume that a reply comes from Benvolio.</p>
<p>Note: Inclusion of the &lt;in-reply-to/&gt; element defined in &rfc4685; indicates the post to which the user is replying. This reply includes two such elements (one pointing to the HTTP URL for the post and the other pointing to the XMPP URI for the post.</p>
<example caption="Publishing a reply"><![CDATA[
<iq from='benvolio@montague.lit/mobile'
id='uv2x37s5'
to='benvolio@montague.lit'
type='set'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='urn:xmpp:microblog:0'>
<item id='c4145006-1c53-11dd-b2d5-000bcd82471e'>
<entry xmlns='http://www.w3.org/2005/Atom'
xmlns:thr='http://purl.org/syndication/thread/1.0'>
<source>
<title>Benvolio&amp;apos;s Microblog</title>
<link href='http://montague.lit/benvolio'/>
<id>tag:montague.lit,2008:home</id>
<updated>2008-05-08T18:31:21Z</updated>
<author>
<name>Benvolio Montague</name>
</author>
</source>
<title>@romeo cappuccino this late in the day?</title>
<link rel='alternate'
type='text/html'
href='http://montague.lit/benvolio/posts/c4145006-1c53-11dd-b2d5-000bcd82471e'/>
<link rel='alternate'
href='xmpp:benvolio@montague.lit?;
node=urn%3Axmpp%3Atmp%3Amicroblog;
item=c4145006-1c53-11dd-b2d5-000bcd82471e'/>
<id>tag:montague.lit,2008-05-08T18:31:21Z:posts-c4145006-1c53-11dd-b2d5-000bcd82471e'</id>
<published>2008-05-08T18:31:21Z</published>
<updated>2008-05-08T18:31:21Z</updated>
<thr:in-reply-to
ref='tag:montague.lit,2008-05-08T18:30:02Z:posts-1cb57d9c-1c46-11dd-838c-001143d5d5db'
type='application/xhtml+xml'
href='http://montague.lit/romeo/posts/1cb57d9c-1c46-11dd-838c-001143d5d5db'/>
<thr:in-reply-to
ref='tag:montague.lit,2008-05-08T18:30:02Z:posts-1cb57d9c-1c46-11dd-838c-001143d5d5db'
href='xmpp:romeo@montague.lit?;node=urn%3Axmpp%3Atmp%3Amicroblog;item=1cb57d9c-1c46-11dd-838c-001143d5d5db'/>
</entry>
</item>
</publish>
</pubsub>
</iq>
]]></example>
<p>Assuming that Romeo has also shared presence with Benvolio and has advertised support for "urn:xmpp:microblog:0+notify", he will receive the reply that Benvolio sent.</p>
</section2>
</section1>
<section1 topic='Message Body' anchor='body'>
<p>Depending on service policies and the value of the "pubsub#include_body" node configuration option, microblogging notifications SHOULD include a message &lt;body/&gt; element for backwards-compatibility with Jabber clients that are not pubsub-capable. It is RECOMMENDED for the XML character value of the &lt;body/&gt; element to be the same as that of the &lt;title/&gt; child of the Atom &lt;entry/&gt;.</p>
</section1>
<section1 topic='Security Considerations' anchor='security'>
<p>This specification does not introduce new security concerns above and beyond those already discussed in the specifications on which it depends.</p>
</section1>
<section1 topic='IANA Considerations' anchor='iana'>
<p>This document requires no interaction with &IANA;.</p>
</section1>
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
<p>The &REGISTRAR; is requested to issue an initial namespace of "urn:xmpp:microblog:0".</p>
</section1>
<section1 topic='XML Schema' anchor='schema'>
<p>This specification re-uses the schema for the Atom content format, i.e., the 'http://www.w3.org/2005/Atom' namespace.</p>
</section1>
<section1 topic='Acknowledgements' anchor='ack'>
<p>Thanks to Ralph Meijer and Paul Scott for their suggestions.</p>
</section1>
</xep>