Skip to content

Instantly share code, notes, and snippets.

@joshdabosh
Last active March 12, 2019 01:11
Show Gist options
  • Save joshdabosh/c1107e86f6922f3a4f7bccd718fe6642 to your computer and use it in GitHub Desktop.
Save joshdabosh/c1107e86f6922f3a4f7bccd718fe6642 to your computer and use it in GitHub Desktop.
Spam a scaledrone chat using node.js. Requires scaledrone-node via npm
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