This is a first attempt at doing something that appears useful with Node.Js.
nosoco is a real-time football score video printer which pushes changes made in a CouchDB database to a web client via Node.Js/Socket.IO.
Git that shit!
Git me here
If you want some info on how to install Node.js ->
node.js Installation on a new Ubuntu installation
If you want some info on how to install CouchDb ->
CouchDB installation on a new Ubuntu installation
Socket.IO aims to make realtime apps possible in every browser and mobile device, blurring the differences between the different transport mechanisms. Socket.IO uses feature detection to decide if the connection will be established with WebSocket, AJAX long polling, etc based on browser capability.
In order to setup Socket.IO simply clone the git:
git clone git://github.com/LearnBoost/Socket.IO-node.git socket.io --recursive
This application requires a CouchDB database; as defined in couchdb.json with the following fields:
Hows it work
Changes made to the CouchDB database are picked up on the couchdb _changes stream; the node clip below attaches an Node event listener to the CouchDB change stream.
The node server will respond to this change event. The steam only contains the ids of the items that have changed so we have to go back to the database to get the data. We then construct a json doc and push these to the client.
Run the node server with the following command:
sudo node server.js
Now visit your browser;
In order to change the scores simply update the 'team_1_score' field using Futon or curl to push changes to the client...