Occasionally I have a conversation on Twitter which, in the full light of the following morning's sobriety, I half remember as being interesting. So I try to replay the conversation the next morning. I use Tweetie as a client which makes things easier cos you can double-click a tweet and if that tweet was in reply to another tweet it'll show that tweet and if that tweet was in reply to another tweet it'll show that tweet and etc. But there's 3 problems with this:

  1. Often people will reply to the same tweet twice. Then someone else will reply to one of those tweets. So the unreplied to tweet(s) won't appear in the conversation timeline
  2. Conversations aren't linear; they often branch. Sometimes they branch into someone you don't follow replying to someone you do follow on the same thread. Given the way Twitter works it's impossible to ever know where a conversation ends
  3. Because the conversation timeline is constructed by the client there's no URI to point at if you want to follow up the conversation in an email or link from a blog post etc

All of these problems are basically the same. Twitter (and the Twitter API) expose that tweet b was in reply to tweet a; it doesn't expose that tweet a had replies of tweets b, c and d. So basically you need access to all tweets ever to work back to a conversation. Which I think means you could only make this with firehose access...

Given /:user/status/:id it would be nice to have /:user/status/:id/conversation. The first job would be to get back to where the conversation started so work through the chain of in_reply_tos to find the first tweet with no in_reply_to (either through the firehose data or directly through the api). If the tweet you're asking for didn't start the conversation (so had an in_reply_to) redirect (303?) to /:user/status/:originating_tweet_id/conversation to avoid multiple URIs per conversation.

From there do some map reduce magic on the firehose data to get every tweet in reply to the originator and every tweet in reply to that and every tweet in reply to that and onwards to plot a branched conversation. No idea how you'd design that interface wise...

That said there might be a simpler way to do this that I'm not spotting...

Other stuff you could do

Plotting all geocoded tweets in the conversation onto a map might be cute. And including any retweets, possibly any favourite counts etc. And publishing a data representation for the conversation. Guessing each tweet would be a SIOC post, you'd link between them with sioc:has_reply and the conversation would be a sioc:Container.

Update (19/01/2011)

Since typing this I've come across two services which do exactly this:

  1. twitter.theinfo.org is pretty much as described above. Feed it a tweet ID and it'll gather up any tweet it was in reply to and any tweets that replied to it recursively and display them as a nice nested list (well nested blockquotes anyway).
  2. www.exquisitetweets.com does a similar job but adds in a little more curation. So you can add / remove tweets from the conversation by hand.

I'd assumed they were both using the firehose but according to @jwheare (creator of Exquisite Tweets) #newtwitter introduced an experimental related results api. So no firehose access required. Details of the new api features here.