Skip to content

Instantly share code, notes, and snippets.

@hongthaiphi
Last active May 19, 2016 06:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hongthaiphi/f2a093e168ef6f959f7e38fbc2e8cc14 to your computer and use it in GitHub Desktop.
Save hongthaiphi/f2a093e168ef6f959f7e38fbc2e8cc14 to your computer and use it in GitHub Desktop.
var login = require("facebook-chat-api");
login({ email: "your_email@gmail.com", password: "your_password" }, function callback(err, api) {
if (err) return console.error(err);
// bán sim cho toàn bộ list friends :))
api.getFriendsList(function (err, data) {
if (err) return console.error(err);
for (var i in data) {
console.log('chao ' + data[i].firstName);
var msg = { body: "Chào " + data[i].firstName + "! Bạn khỏe không?" };
api.sendMessage(msg, data[i].userID);
}
console.log(data.length);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment