Created
August 16, 2016 04:24
-
-
Save kamath/c08265e6a7c840dc0929a8b19381963f to your computer and use it in GitHub Desktop.
Script to spam someone on Facebook messenger via node.js
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
//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; | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Scam