Line breaks in twtxt

twtxt is a minimalist news feed file format and protocol for sharing status updates. You can compare it to RSS, the Finger protocol, and a decentralized Twitter.

The twtxt file format does not allow newlines in the text of the status update ("twt"). Since users of competing technologies often use line breaks in their statuses, not having line breaks limits users' ability to write what they want in twtxt. Therefore, I propose a backwards-compatible convention for line breaks in twtxt: when the client sees a sequence of twts with the same timestamp in a feed, have it join their text with a newline or another line-breaking sequence as appropriate. To simplify parsing, the client should not merge twts with the same timestamp in the anomalous situation when they do not occur in sequence.

A feed following this convention looks reasonable in a client that does not understand it as long as the client displays twts with the same timestamp in the order they appear. For example, buckket's original implementation of twtxt renders

1845-01-29T12:00:00Z	Once upon a midnight dreary, while I pondered, weak and weary,
1845-01-29T12:00:00Z	Over many a quaint and curious volume of forgotten lore—

as

➤ http://127.0.0.1:8081/poe.txt (175 years ago):
Once upon a midnight dreary, while I pondered, weak and weary,

➤ http://127.0.0.1:8081/poe.txt (175 years ago):
Over many a quaint and curious volume of forgotten lore—

The convention is already implemented in the twtxt.tcl library and GUI feed reader.


Tags: file format, Internet, my work, programming, protocol.