Bored? Watch me type live!
I’m writing this post. You know because you’re reading it and it’s published, but what about now, as I’m writing? You don’t know I’m writing this post. I could tweet or soup or friendfeed the fact, of course, but that really wouldn’t get us much now, would it. For a while, I thought I could publish draft posts, but that’s sort of tricky, involves too much decision making from me as a writer and you as a reader and frankly, if it’s a draft, it’s not published.
So, the only alternative is to write two halves of a chat script, separating writer and reader roles, and make it a little smarter to support editing: moving paragraphs, deleting and inserting chunks, and plain old typing. Ideally, you should be able to attach this writer client to any textarea so it sends its editing actions to the server where they get forwarded to all listening reader clients.
With javascript, you dive into DOM territory to quickly find 3 kinds of supported actions:
onkeypresssounds simple enough and bandwidth efficient, but it’s probably very easy to mess up;onchangeis just bruteforcing it, but it’s a good enough start and a nice way to get back in sync when things go wrong;- Firefox 3 supports
oncopy,onpasteandoncutevents but I haven’t played with those yet. (Running Debian stable keeps me away from lots of temptations, one year at a time.) - (yes I can count) another method would ask the writer to jump through certain hoops in order to help the script determine what kind of editing action is going on.
I haven’t given much thought to the reader side of things yet. If you have any ideas, please share! In the meanwhile, I’ll go play a little bit and see what I can actually come up with in terms of code and a demo.



