Last active
March 12, 2019 01:11
-
-
Save joshdabosh/c1107e86f6922f3a4f7bccd718fe6642 to your computer and use it in GitHub Desktop.
Spam a scaledrone chat using node.js. Requires scaledrone-node via npm
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
const Scaledrone = require("scaledrone-node"); | |
const drone = new Scaledrone("[REDACT]", { | |
data: { | |
name: "[REDACT]", | |
} | |
}); | |
drone.on("open", error => { | |
if (error){ | |
return console.log("error sowwy"); | |
} | |
console.log("succ ess"); | |
const room = drone.subscribe("[REDACT]"); | |
room.on("open", error => { | |
if (error) { | |
return console.error(error); | |
} | |
console.log("joined room woooooo"); | |
}); | |
}); | |
function send(){ | |
drone.publish({ | |
room: "[REDACT]", | |
message: "[REDACT]", | |
}); | |
} | |
drone.on("close", event => { | |
console.log("Conn closed", event); | |
}); | |
drone.on("error", error => { | |
console.error(error); | |
}); | |
setTimeout(function() {console.log("spam started");}, 2000); // just so drone can connect in time | |
setInterval(send, 200); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment