Friday, August 13, 2010

Web interface for typewriter

I spent this week primarily working out how I would interface the anonymous public over the internet. It would definitely come in the form of a website, however I would need to come up with a solution of how to a) get users engaged for a prolonged period, and b) encourage cohesive input.

A traditional website utilises fully synchronous delivery of content. The flow of data for a basic form submission is as follows:


  1. User requests a url > Server responds with content

  2. User fills out form and submits data > Server processes request, and serves up a new page based on data



Between these steps is a minor delay while data is transferred/processed. This delay is usually tiny - sub second range. The huge time hog is in the server having to send a completely new page through for the user's browser to parse and display.
Another major disadvantage is that if an element of a web page changes or is added (for example another user inputs data from elsewhere) the client who has just downloaded the page has no idea that that change has taken place; the only way they can keep track of changes if they repeatedly refresh.

Asynchronous websites have two sneaky tricks up their sleeve: firstly, when a form is submitted, the user is kept on the page that they are currently on, and once the server has processed the request their browser only updates the section of the page that has changed
The other trick is that a page can poll the server for updates and only if there is an update is that particular update served to the client. This saves massively on time, and is very good for user experience as they see data coming in often, and not only on demand. People these days don't like to have to go looking for data, they appreciate it if it is provided to them when it happens.

For these reasons I decided that it would be necessary to utilise the asynchronous model for my site. I did not want users submitting a word when another has just said the same thing. With a synchronous website unintentional duplication would be very common.
I have never done an asynchronous site before because it uses a language which I have not used before: javascript. I have a little exposure to JS through my job, so I know what it is capable of, but no idea how to write it.

The workflow I have planned is as follows:

  1. A user comes on to the site

  2. User logs in (this is to attempt to reduce malicious input

  3. User reviews where the current 'story' is up to

  4. User either simply sits back and watches the 'story' develop, or contributes words

  5. Constant feedback is provided by both text on the site and a live stream of the installation


  6. This would all be served asynchronously, so the user would only be visiting one page.

    To date, I have managed to get a basic site joining all user's strings together in realtime. When a word is submitted it is checked against a dictionary to verify that the input is indeed a word.

    Tags: website ajax

    Comments

    Add a comment

    Name:

    Website:

    Comment:

    Twitter username: (if you want to be informed of replies to your comment via twitter)

    If entered, the twitter username field is used to subscribe to replies to your comment. When someone replies, a tweet will be posted to @yourusername.

    All comments are moderated before being posted, so be nice.

    All fields are optional, your twitter username will not be public if you choose to put it in