mod_chat

A Zotonic powered chatroom.

If you are young you probably won't know what a chatroom is. They were how people interacted on the web before the 2.0.

I remember we used to have the Virtual Irish Pub, Oceanfree and Widemouth in Ireland.

Anyhow, as an exercise in finding out how to do some fancy real-time stuff with Zotonic I decided to write a simple chatroom. It does absolutely no logging, it just takes the messages you type in and sends them directly to all the other connected clients. If you are not connected at the time of a message you will never see it.

I might modify it when I get a chance to do some logging, and also to look a bit better by default.

I borrowed a lot from mod_logging when writing this.

Get the Code

See the demo (requires login with facebook)

Comments

  • avatar

    Andreas

    Posted 3 years, 10 months ago.

    Perhaps have a link to a sample chatroom... ?
    with sources how you use the chat.

    Otherwise, looks really neat. A tidy example of a mod, in my opinion.

  • avatar

    Michael

    Posted 3 years, 10 months ago.

    I have added instructions for installation here: http://code.google.com/p/zchat/wiki/Installation

  • avatar

    Andreas Stenius

    Posted 3 years, 10 months ago.

    Tried the demo. Really nice. Room for improvements, of course. But still - considering the amount of code (or lack there of ;c)

    Had some escaped char issues though (pasted chat log here):

    Andreas: Ok, nice. I\x27m in!
    Andreas: Oops. Seems to be escaping the \x27 char. How about \x22 ? and / \x3c \x3e % # \x26 . This is the end ;c)
    Andreas: They should probably be html encoded..


    Would be nice to have a list of others that are currently logged in to the chatroom too (if you haven't thought of that already)

  • avatar

    Michael

    Posted 3 years, 10 months ago.

    I had thought of that, actually there are a number of things I would like to add as soon as I get time.