Last active
April 28, 2018 14:10
-
-
Save lookfirst/202c07af1b716edab2104ccf4ccc40e2 to your computer and use it in GitHub Desktop.
Script to add workers to litecoinpool. Generate the names somehow. Run it in a Chrome devtools console window while logged into the workers page...
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 names = []; // add your names to the array however you want | |
var password = '123123'; | |
var psselector = "input[name='ps']"; | |
var ps = $(psselector).val(); | |
console.log(ps); | |
var posts = []; | |
names.forEach((name) => { | |
var username = name; | |
var func = () => { | |
var data = { 'username': username, 'pass': password, 'ps': ps, 'addWorker': 'Add Worker' }; | |
$.post('/account', data).done((results) => { | |
// reset the ps value when you need to | |
ps = $(results).find(psselector).val(); | |
console.log(ps); | |
}); | |
} | |
posts.push(func); | |
}); | |
// Give a 1s delay so you don't hit their DDOS protection | |
var clear = setInterval(() => { | |
var popped = posts.pop(); | |
if (!popped) { | |
console.log('All done!'); | |
clearInterval(clear); | |
} else { | |
popped(); | |
} | |
}, 1000); | |
// This code is delete all the buttons! | |
/* | |
var psselector = "input[name='ps']"; | |
var ps = $(psselector).val(); | |
var deletes = []; | |
$("input[value='Delete']").each((index, button) => { | |
var buttonName = button.name; | |
var data = {}; | |
data[buttonName] = 'Delete'; | |
deletes.push(data); | |
}) | |
var clear = setInterval(() => { | |
var popped = deletes.pop(); | |
if (!popped) { | |
console.log('All done!'); | |
clearInterval(clear); | |
} else { | |
popped.ps = ps; | |
$.post('/account', popped).done((results) => { | |
ps = $(results).find(psselector).val(); | |
console.log(ps); | |
}); | |
} | |
}, 1000); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment