Created
July 24, 2019 18:29
-
-
Save nurumayuapp/33f036329ee46294377253446efe1b8b to your computer and use it in GitHub Desktop.
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 sum = 0; | |
var count = 0; | |
var $counter = document.createElement('div'); | |
$counter.setAttribute('style', 'position: fixed; width: 300px; min-height: 20px; bottom: 14px; right: 14px; background: rgba(0,0,0,0.7); border-radius: 10px;'); | |
document.body.appendChild($counter); | |
var autoLike = function () { | |
let buttons = document.querySelectorAll('div[data-testid="like"]'); | |
if (buttons.length <= 0) { | |
restart() | |
return; | |
} | |
sum += buttons.length; | |
for (i = 0; i < buttons.length; i++) { | |
let button = buttons[i] | |
setTimeout(function () { | |
button.click(); | |
count++; | |
$counter.innerHTML = '<div style="color: #fff; text-align: center; padding: 20px 0;">' + count + '/' + sum + '件いいねしました!</div>' | |
}, 10000 * i) | |
} | |
setTimeout(function () { | |
restart(); | |
}, 10000 * buttons.length) | |
}; | |
var restart = function () { | |
document.querySelectorAll('a[role="tab"]')[0].click(); | |
setTimeout(function () { document.querySelectorAll('a[role="tab"]')[1].click(); }, 3000); | |
setTimeout(function () { window.scrollTo(0, 0); }, 6000); | |
setTimeout(function () { autoLike(); }, 10000); | |
}; | |
restart(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment