fb-chat
v0.0.7
Published
Simple Facebook Chat XMPP client compatible with Node 0.8
Downloads
2
Readme
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',
secret_key : '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