Last active
May 19, 2016 06:08
-
-
Save hongthaiphi/f2a093e168ef6f959f7e38fbc2e8cc14 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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