]> www.wagner.pp.ru Git - oss/stilllife.git/blob - doc/distributed-comments.txt
*** empty log message ***
[oss/stilllife.git] / doc / distributed-comments.txt
1                                                                 V. Wagner
2                                                                  March,2008     
3
4         Distributed Blog Commenting Prototcol
5
6 Status of this Memo
7         
8         I just write it. If considerable interest appear, we might submit it
9         to the IETF as RFC draft
10
11 Copyright
12
13         Copyright (c) by Victor B. Wagner, 2008   
14
15 Abstract
16
17         This document describes a protocol which can be used by different
18         blog sites and web-based RSS aggregators to exchange the comments,
19         made by users to the blog entries either originating on this site
20         or recieved from other sites.
21
22
23 1   Introduction
24
25 1.1 Purpose of protocol
26
27         Some blog sites are more like discussion forums. They allow reader
28         to comment on blog entries identifying themselfes using some
29         identity such as OpenID. If it is quite possible to distribute blog
30         entries to other (mirror) sites using protocols like RSS/Atom feeds,
31         to distribute load and improve availability of particular blog,
32         there is no way to allow users to make comments on mirror site and
33         distribute this comments to all other copies of same blog.
34
35         Proposed protocol closes this gap.
36
37 1.2 Requrements
38
39     Sites participating in this protocol should be able to serve http
40         request [HTTP] and send those.
41
42 1.3 Terminology 
43
44    The capitalized key words "MUST", "MUST NOT", "REQUIRED", "SHALL",
45    "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and
46    "OPTIONAL" in this document are to be interpreted as described in BCP
47    14, RFC 2119 [TERMS].
48
49 2  Protocol overview
50
51 2.1 Basic terms definition
52
53 2.1.1 BLOG
54
55         Blog or weblog is a web resource typically consisting of series of
56         messages (POSTS) which appear on the blog web-page starting from
57         most recent one. Each blog post can have separate web page, but it
58         is guaranteed, that by visiting well-known and constant blog URL
59         any HTTP-client would get most recent post first.
60         Typically web page on this URL contain some special links which
61         point to RSS feed of the posts, author information (FOAF) open-id
62         server which confirms blog owner identity etc. For the purposes of
63         this protocol blog is identified by this URL.
64
65
66 2.1.2 User
67
68     User is an entity which can prove  identity to at least to one of
69         the servers. This server can confirm this identity to other servers
70         with OpenID or simular means. So, comments made by the user carry
71         user identity verified by the server either directly or indirectly
72         via another server.
73
74 2.1.3 Comment
75         
76         Piece of textual information associated with some post in the
77         particular blog and, may be with another comment to the same post.
78
79 2.2 Required comment proprieties
80
81         Each comment in the system which support  this protocol MUST  have
82         following proprieties:
83
84 2.2.1 Comment text
85
86         Fragment of the text which MAY contain some XHTML markup, including
87         references  to other web resourses, including another comments,
88         blogs or blog posts.
89
90 2.2.2 Globally unique identifier
91
92         Globaly unique identifier is created by site where comment was
93         originally posted. It MUST contain hostname of the originating site
94         and some string which ensures uniqueness among other comments
95         originatig to this site
96
97 2.2.3 Blog, where comment was posted to
98
99         Original URL of blog where comment belong
100
101 2.2.4 Blog post where comment was posted to
102
103     Permanent URL of blog post on its originating site. This URLs
104         are always included into RSS/Atom feeds, so any mirror site would
105         have no problem determining this URL
106
107 2.2.5 Original posting date
108
109         Timestamp with precision of second when comment is posted  
110
111         Also comments might have following OPTIONAL properities
112
113 2.2.6 Author
114
115         URL of verified user identitity of user, who submitted this comment. 
116         If idenitity was provided via OpenID or similar protocol, it MUST
117         have
118         form of URL. If user authenticated on the site, where comment was
119         submitted, directly it SHOULD be OpenID URL which would prove  identity
120         of this user to other sites.  
121
122         Sites participating in this protocol MAY allow anonymous comments.
123         If comment is anonymous, Author propriety MUST be omitted from
124         this comment.
125
126 2.2.7 Modification time
127
128         If comment was changed after its initial submission, it MUST contain
129         additional timestamp specifying last change date. Servers conforming
130         to this  protocol SHOULD allow comment author to change comments.
131
132         There is one special case - deletion of comments. Owner of blog,
133         i.e. user with same identity as blog url SHOULD be able to delete
134         any comments in his blog.   
135          
136 2.2.8 Reference to parent comment
137
138         If site allows to comment on another comment in the blog entry, not
139         only blog entry itself, unique identificator of parent comment
140         SHOULD be recorded as comment propriety. If this propriety is
141         absent, any server, recieving this comment, SHOULD assume that it is
142         made on blog entry itself.
143
144 3. Comment exchange protocol
145
146 3.1     URL structure
147
148         Any site participating in this protocol should provide following
149         web resouces:
150
151 3.1.1. Blog list
152
153         Page which lists blogs, which can be commented on this site
154         This page should have content type text/plain and list blog URLs
155         one per line
156
157 3.1.2. Comment list
158         
159         If URL consisting of BLOG list URL, slash ("/") and blog URL is
160         requested via HTTP GET method, it should return text/plain list of
161         recent comments (most recent first) in the form 
162         
163                 timestamp whitespace comment-id
164
165         one per line.
166         If this URL is requested with skip=number parameter (i.e. appended
167         with question mark, workd skip equal sign and number), it should
168         return list of more earlier comments. 
169
170 3.1.3 Comments itself      
171         
172         If URL described in 3.1.2 is requested via POST method and POST
173         request body consists of list of comment identifiers, separated by
174         newlines, it should return text/xml data containing specified
175         comments using XML schema described in the section 4 of this
176         document. 
177
178         Comments MAY be ordered either earliest first or in order listed in
179         the request.
180
181         Any conforming implementation sending the request SHOULD send
182         identifiers of requested comments from earliest to latest.
183
184 3.1.4 Posting notification
185
186         Conforming implementation should understand request to the URL 3.1.1
187         either by POST by or GET method, 
188         which contains parameter notify=blog-URL. This request means that
189         site sending this request wants to notify this site that it have new
190         comments on the specified blog.
191
192         If blog-URL doesn't belong to this site, it MAY respond to this
193         request with 406 (Not Acceptable) HTTP response code.
194         
195         Otherwise it should respond with 200 response and immediately
196         initiate procedure of recieving comment from the site which sent
197         request.
198
199         Conforming implementation SHOULD send notify requests only if
200         comment was posted on the site to the blog originating on the site
201         where request is sent, unless it is behind firewall or proxy. In
202         this case it MAY send such requests for each blog commented on it
203         to some relay site, if permitted by the relay site administrator.  
204
205         If notifying site is behind NAT or firewall and connection cannot to
206         it cannot be stablished, reverse protocol described in section 3.3.3
207         could be used.
208
209
210 3.2 Declaring support of this protocol
211
212 3.2.1 Declaring support in the protocol on the blog page
213
214         Each site which supports this protocol SHOULD add link tag to its
215         blog pages with rel="comment-exchange" and href pointing to URL,
216         described in the section 3.1.1. 
217
218 3.2.2 Declaring protocol URL during comment exchange.
219         
220         Each site which performs comment exchange procedure should provide
221         its peers means to retrieve comments from it. This is done by adding
222         custom HTTP header X-Comment-Exchange-URL to all requests to
223         protocol pages. This header should contain URL of page described in
224         3.1.1, and host name in this URL MUST resolve to the same IP address
225         request is made from.
226
227         
228 3.3. Connect exchange procedure
229
230 3.3.1 Procedure initiation.
231
232         Site supporting this protocol SHOULD check presense of link
233         rel=comment-exchange on all sites it retrieves blog entries via
234         RSS/Atom. If this link is found it MAY periodically initiate comment
235         exchange procedure with these sites.
236
237         It also MAY initiate this procedure with any site which was known
238         to initiate this protocol with it before.
239
240         If 404 NOT FOUND HTTP response code is recieved when requesting URL
241         3.1.1, this site SHOULD be removed from the list of polled sites
242         until either explicit user interaction or first protocol session
243         initiated from that site.
244
245 3.3.2 Normal (PULL) procedure
246
247         1. Site requests lists of blogs from URL 3.1.1
248         2. For each blog interesting to this site, list of available
249                 comments is requesed from URL 3.1.2. If site has reasonable
250                 expectations that it can miss some comments, which are not
251                 listed on first page, request page multiple times using skip 
252                 parameter.
253         3. Prepare list of missing comments, earliest first and send it to
254           site  
255         4. Repeat steps 2,3 for each blog copy of each is carried on this
256           site.
257
258 3.3.3. Reverse (PUSH) procedure
259
260         1. Send notify request (3.1.4) using POST method with list of
261         available comments as specified in 3.1.3 in the POST body.
262         
263         2. Recieve list of requested comments as  text/plain resoponse to
264         the POST request.
265
266         3. Send XML stream of the comments using POST request to the same
267         URL with content type text/xml
268
269         4. Repeat steps 1-4 for each blog comments for which are to be
270         pushed to this site.
271
272         when using PUSH method X-Comment-Exchange-URL header MAY be omitted.
273
274
275 4. Comment stream XML format
276
277 4.1 Comment stream XML document have <comment-stream> root node.
278         Contents of this stream is sequence of <comment> element.
279 4.2     Comment element should contain following elements
280         <comment-id>unique-identifier</comment-id>
281         <blog>blog-URL</blog>
282         <post>post-URL</post>
283         <parent-id>unique-identifier</parent-id>
284         <author>url</author>
285         <posted>date</posted>
286         <edited>date</edited>
287         <body>text of comment with optional XHTML markup</body>
288         Some of this elements are OPTIONAL (see section ).
289
290 4.3. Comment deletion
291         If comment element contain element 
292         <deleted/> and <author> element contains either same  URL as 
293         original comment with same <comment-id> or URL of blog, comment
294         belongs to,
295         comment with given identifier should be removed
296         from the user's view, but deletion notice retained in the database 
297         in case that same
298         comment would be sent from other site which didn't have recieved
299         deletion message yet. 
300
301
302 4.4     Banning user from commenting.
303         If comment element contains element
304         <ban set="1">identity URL</ban> instead of body or along with 
305         <delete> element, 
306         and comment author identity is same as
307         identity of blog it belongs to, it means that user with given
308         identity should no more be allowed to comment in this blog, and any
309         existing comments from this user should not be offered to other
310         sites, requesting comments using this protocol, even if these
311         comments has earlier timestamp than ban notice.
312
313 4.5 Removing ban
314
315         If comment element contain element
316         <ban set="0">identity URL</ban> than previously set ban should be
317         removed.
318
319 5. Full Copyright Statement
320         Would write it if document is to be submitted to the IETF as RFC
321         draft
322
323
324
325