A demonstration of a very rudimentary chatbot implemented in Node.JS using Socket.IO
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
test
.bowerrc
.compass.rb
.editorconfig
.gitattributes
.gitignore
.jshintrc
Gruntfile.js
LICENSE
README.md
component.json
package.json
server.commands.js
server.config.json
server.helpers.js
server.js
server.room.js

README.md

Chatbot Demo

A demonstration of a very rudimentary chatbot --- Actually, there's no AI yet, so it's not much of a bot at the moment.

Live demo: http://chatbot.rexmac.com

The server uses NodeJS, Socket.IO, and Socket.IO-sessions.

The client uses Bootstrap, H5BP, and jQuery CSSEmoticons.

This project is several years old. I recently (29-03-13) updated it to use Grunt and to ensure it still (somewhat) works. This is one of many projects that I hope to experiment with more in the future if I ever find the time.

Installation

  1. Clone this repository.
  2. Run npm install && bower install.
  3. Run grunt.
  4. Start the server: npm start
  5. Navigate to http://127.0.0.1:1337 in your browser.

Usage

Type messages in the input box and receive a response. It really is that simple. Even more so, since there is no AI yet so the server only has one response. Unless you type in one of the commands described below.

Commands

The following commands may be entered to generate different effects. Each command must be preceeded with a forward slash character, e.g., /help.

The last 50 commands are stored for reuse. The and arrow keys can be used to navigate the command history.

/help [command]

Displays generic help text. If provided a command argument, displays help about that command.

/flip

Flips a coin and displays the result.

/fortune

Displays a "fortune" from the fortune program.

/image query

Displays the first result from a Google Images search for the given query.

/roll [size]

Rolls a size-sided die and displays the result. The default size is 6.

Credits and Inspiration

I wrote this a few years ago and most of my notes and documentation from the time are now lost. I'm sure I found inspiration and borrowed code from other open-source demonstrations circa 2011. If you recognize any code or techniques used here, and you had them online in mid to late 2011, please let me know so that I can give you proper credit.

Licence (MIT)

Copyright (c) 2011 Rex McConnell (http://rexmac.com/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.