All Projects → SideraX → node-facebook-chat

SideraX / node-facebook-chat

Licence: other
No longer supported

Programming Languages

javascript
184084 projects - #8 most used programming language

No longer supported

Node Facebook Chat

Simple Facebook Chat XMPP client

Dependencies

Ubuntu :

sudo apt-get install libexpat1 libexpat1-dev libicu-dev

#Install

npm install facebook-chat

#Example

var FacebookChat = require("facebook-chat");

var params = {
  facebookId : 'User Facebook ID',
  appId : 'Your Facebook application ID',
  appSecret : 'Your Facebook application secret',
  accessToken : 'User Facebook access token'
};

var facebookClient = new FacebookChat(params);

facebookClient.on('online', function(){
  //Get friend list
  facebookClient.roster();

  //Send a message
  facebookClient.send('[email protected]', 'test');

  //Get a vcard
  facebookClient.vcard();

  //Get a friend vcard
  facebookClient.vcard('[email protected]');
});

facebookClient.on('message', function(message){
  console.log(message);
});

facebookClient.on('presence', function(presence){
  console.log(presence);
});

facebookClient.on('roster', function(roster){
  console.log(roster);
});

facebookClient.on('vcard', function(vcard){
  console.log(vcard);
});

facebookClient.on('composing', function(from){
  console.log(from + ' compose a message');
});

#License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].