Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Script to add workers to litecoinpool. Generate the names somehow. Run it in a Chrome devtools console window while logged into the workers page...
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