The lead developer at Mosaic, Brighton with a passion for web application development and motorcycles.
I have written a two part article for this months .net magazine detailing how easy it is to write a Google Talk bot with the evented power of Node.js.
“Programming a chat bot was once the domain of the hardcore hacker, tapping packets as they passed over the wire from proprietary client applications to closed source servers, but not any more!”
In issue 225 (out now) you will learn how to build a Google Talk bot that is able to set its own status messages and accept new contact requests. I then follow this up in part two of the tutorial (issue 226, on sale 28 February) by adding message bounce back and Twitter searching functionality.
Additionally, I give a little bit of history from both Node.js and XMPP/Jabber along with some background on projects and companies that are using Node.js and hiring experts. As an aside there is a micro-tutorial on creating webpages with Node.js using the express framework like the bots demo website.
There is also a demo bot and documentation over at njsbot.simonholywell.com, which is hosted on cloudno.de (Thanks Hans). The source code for the demo site and bot can be found on github.
When I began using Cloudno.de recently to have a go at Node.js and CouchDB I stored my username and password in plain text in a configuration file. If you are also looking to get CouchDB going with CloudNo.de then my earlier Getting started with Node.js and CouchDB post may be of interest.
The configuration file was fine for testing as nobody who came across the database login details could do any real damage, but as the project got more interesting I wanted to send it live and these details would need to be kept private.
Thankfully the Nodester platform, which CloudNo.de is using, has environment variables built in and you can use them to store sensitive data such as passwords. It is also good to know that the variables will persist even after the host machine is cycled.
Node.js and CouchDB feel like they were made for each other right from the very first time I used them. With the cradle node package the integration becomes even easier.
Whilst both Node.js and CouchDB are open source with packages for most operating systems it maybe easier for you to start out using a hosted solution such as CloudNo.de (has CouchDB now) or Nodester for example. As far as the CouchDB portion goes there is only one place to go and that is IrisCouch.
With the exception of IrisCouch they are all in private beta so there might be a small wait before you get access.
I wrote the following example code before CloudNo.de supported CouchDB so it references IrisCouch, but the setup is similar.