Skip to content

Instantly share code, notes, and snippets.

@spudtrooper
Created January 20, 2021 15:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spudtrooper/ec499b795f4d50883e5e96d9d9d50e5a to your computer and use it in GitHub Desktop.
Save spudtrooper/ec499b795f4d50883e5e96d9d9d50e5a to your computer and use it in GitHub Desktop.
Like all tweets on a page
(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