Created
January 20, 2021 15:57
-
-
Save spudtrooper/ec499b795f4d50883e5e96d9d9d50e5a to your computer and use it in GitHub Desktop.
Like all tweets on a 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
(function() { | |
let divs = document.getElementsByTagName('div'); | |
let count = 0; | |
for (var i = 0; i < divs.length; i++) { | |
let div = divs[i]; | |
if (div.getAttribute('aria-label') && | |
div.getAttribute('aria-label').match(/.*\. Like$/)) { | |
div.style.backgroundColor = '#00ff00'; | |
div.click(); | |
count++; | |
} | |
} | |
window.scrollTo(0, document.body.scrollHeight); | |
console.log('Liked ' + count + ' tweets'); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment