[Chugalug] Anyone played with real-time web updates?
danlyke at flutterby.com
Tue Oct 2 03:04:01 UTC 2012
I just discovered the Meteor web server, and am looking for cool things
it can do.
Meteor is a server you run to push real-time (for second or so meanings
of "real time") data to web pages. So, for instance, if you were
writing the next Twitter, you'd create a web page that loaded a Meteor
and then you'd connect to the control port of the server and send it
updates for channels.
So for my test app I wrote a little HTML page that had an input box, a
submit button, and a <ul id="messages"></ul>.
My submit button takes the input box contents and sends it off to a CGI.
The CGI opens a IO::Socket::INET stream to the control port, prints
ADDMESSAGE streamname [the contents of the text box]
which then causes Meteor to send an event out to my HTML page, which
$("#messages").append("<li>" + data + "</li>")
Poof. Instant chat server.
Their demo is little twinkly stars dependent on the IP address of the
server that's accessing their web page currently.
A little JSON and some database storage, and more stream names, and
you've got a small Twitter...
This thing is kinda cool.
More information about the Chugalug