Created
November 11, 2019 20:06
-
-
Save fridgerator/3c1ef7e5c7d8e0c847079a29a737cf33 to your computer and use it in GitHub Desktop.
DevShop bot
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 inbox = document.querySelector('#ba') | |
const backlog = document.querySelector('#dev') | |
const dev = document.querySelector('#dev0') | |
const test = document.querySelector('#test') | |
const done = document.querySelector('#done') | |
const people = document.querySelector('#people') | |
let interval | |
let loop = () => { | |
;[inbox, backlog, dev, test].forEach(lane => { | |
let laneReceivers = lane.querySelectorAll('.receiver') | |
Array.from(laneReceivers) | |
.reverse() | |
.forEach(el => { | |
if (el.querySelector('.storeitem-icon')) return | |
el.click() | |
let possible = Array.from(people.querySelectorAll('.person.possible')) | |
if (possible.length) possible.reverse()[0].click() | |
}) | |
}) | |
} | |
let startMe = () => { | |
interval = setInterval(() => { | |
loop() | |
}, 100) | |
} | |
let stopMe = () => { | |
clearInterval(interval) | |
} | |
let startButton = document.createElement('div') | |
startButton.id = 'startmebutton' | |
startButton.appendChild(document.createTextNode('Start')) | |
startButton.style.position = 'absolute' | |
startButton.style.top = '10px' | |
startButton.style.left = '400px' | |
startButton.addEventListener('click', () => { | |
startMe() | |
}) | |
let stopButton = document.createElement('div') | |
stopButton.id = 'stopmebutton' | |
stopButton.appendChild(document.createTextNode('Stop')) | |
stopButton.style.position = 'absolute' | |
stopButton.style.top = '10px' | |
stopButton.style.left = '480px' | |
stopButton.addEventListener('click', () => { | |
stopMe() | |
}) | |
document.body.appendChild(startButton) | |
document.body.appendChild(stopButton) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment