INTRODUCTION : Group Chat With Facebook Account

Chat with facebook account is not a unique thing. Since a lot of web apps (and facebook itselves) allows chat using facebook user account authentication. Facebook allows an app to access its users personal facebook-resources like pictures, friends list, profile info etc... using Graph API. And thats cool :) Here I have done something similar, but with an extra fitting. It will be interesting if some one is always there to chat(24 X 7) with. Some kind of robot, or simply a Chatterbot.

Facebook App & Graph API

Facebook graph api is very simple to learn and is an ease to work with. A great tutorial will be available from http://developers.connect.facebook.com/docs/reference/api/. Now we can register a new application using Create New App option from https://developers.facebook.com/apps. I have selected Heroku to host my node.js app.

Node.js on Heroku

Heroku allocates Github repository while creating an app. Means, it will allow us to create a project folder in our harddisc and We can add or modify files into it. These files will always sync with Heroku servers. We can push the files into heroku server using commands through command prompt. Heroku describes all these things while creating the project. Okay, let's discuss about our Javascript files,

  • Request Handler
       This code will handle all the requests to our node application. It will mange the authentication, and redirect requests to corresponding files. More...
  • Facebook Connector
       This code is responsible for all the communication with facebook servers. For eg: getting user name, profile link, photos etc... More...
  • Chatterbot Manager
       Chatterbot manager manages all the queries for chatterbot. It can direct message from users to the bot, generate a reply for the message and send to the wright user. More...
  • Socket.Io
       Web.js is running & controlling the socket.io connections. We are expecting a websocket connection(server push), but unfortunately it fall backs to long polling. (Since Heroku is    not supporting websockets currently :( ). More...
  • User Interface
       And finally our user interface. Only one page is necessary. We can present all the things to user via this page. HTML5 supported browsers are highly recommended, because some    HTML5 specific controls & protocols are using. More...


View demo