tReplace Twitterformat Proposal


/replace last With this tweet.
<strong>/replace</strong> <em>-tweetOffset</em> With this tweet.
<strong>/replace</strong> <em>tweetID</em> With this tweet.


The tReplace Twitterformat (e.g., /replace last With this tweet.) informs your followers that you have completely replaced the contents of an existing tweet (in the example above, your last tweet). Twitter clients that implement tReplace can alert users in realtime that a tweet has been updated (e.g., by displaying the existing tweet in strikethrough and displaying the text of the new tweet following it).

Raison d'être

You send a tweet and need to edit or change it after the fact. The edit or change is not as simple as a typo or affects more than a single word or a short phrase and so it cannot be updated easily with a tStrike or tInsert command. In such cases, it's easier to simply replace the whole tweet.

The current way of achieving this in Twitter is to delete your existing tweet and tweet the updated one. This is less-than-ideal for your followers since they won't get notified of your intent. Your followers won't be notified that you deleted the first tweet if they have it cached in their Twitter clients (a shortcoming that the tDelete Twitterformat addresses). They also can't see at a glance that your new tweet is actually an update to an existing tweet (there is no relationship created between the two tweets). The tReplace Twitterformat provides a solution to this problem.

When you use tReplace, your followers are notified, in realtime, that you have updated your tweet by entirely replacing its contents. Twitter clients that implement the tReplace Twitterformat will update their timelines and display the updated tweet in relation to the existing tweet (e.g., by displaying the existing tweet in strikethrough with the contents of the updated tweet following it). This will impact future conversations as your followers may respond differently based on this new piece of information (e.g., by not replying to your original tweet but to the updated version).

Manual usage

The tReplace Twitterformat is simple enough to be authored manually by users. e.g.,

/replace last With this tweet.

The above communicates the user's intent to replace her previous tweet with her current tweet.

/replace -2 With this tweet.

The above communicates the user's intent to replace her second-to-last (the tweet before her previous tweet) with her current tweet.

/replace 10242048 With the contents of this tweet.

It is harder for the user to find the tweetID unless the client provides a mechanism that reveals it.

Implementation guide for Twitter client authors

A. User wants to update an existing tweet

1. Limited client support:

  1. The user gets the tweetID of a tweet easily (e.g., through a context menu on a desktop app)
  2. User writes out the tReplace command manually, as per the Manual Usage section, above.

2. Full implementation:

  1. The user selects an existing tweet and alters it.
  2. Automatically create the tReplace tweet for her and tweet it.

One possible flow (for desktop apps):

  1. User selects an existing tweet and selects the Edit option
  2. User edits the tweet
  3. The client creates a tReplace tweet (e.g., /replace 10242048 With the contents of this tweet.) and tweets it.

Note: If you are going to implement a generic edit function for existing tweets, you may have to run a diff between the old and new tweet and use a tInsert or tStrike command if the change is relatively minor (a removed word or phrase or an inserted word or phrase) and only use tReplace if too much has changed in the edit to use tInsert or tStrike. (tInsert and tStrike isolate changes better and should be preferred over tReplace when possible for simple changes.)

B. Client receives a tReplace tweet

  1. Extract the tweet reference ("last", -tweetOffset, or tweetID), and the text of the new tweet.
  2. If the tweet reference is "last" or in relative offset format (-tweetOffset), find the corresponding tweetID.
  3. Is the tweet with the referenced tweetID being shown in the user's timeline (i.e., is it currently cached?) If not, don't do anything and ignore the tReplace tweet.
  4. Alter the existing tweet in the timeline to show that it has been entirely replaced (e.g., display the whole tweet in strikethrough)
  5. Display the new contents of the tweet in a manner that makes it clear that the new tweet is a replacement of the former one (e.g., add the text of the new tweet at the end of the old tweet being shown in strikethrough).
  6. (Optional) Bring this to the user's attention via a Growl notification or some other ambient alert mechanism.
  7. Don't display the tReplace tweet itself in the user's own timeline as it doesn't add any further value as a separate tweet.


This Twitterformat Proposal is released under a Creative Commons Attribution License.