Skip to content

Instantly share code, notes, and snippets.

@helloromero
Forked from erayarslan/delete.js
Created December 8, 2018 15:25
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 helloromero/9f08c9cd387da0b1c6f0a9c577a34f30 to your computer and use it in GitHub Desktop.
Save helloromero/9f08c9cd387da0b1c6f0a9c577a34f30 to your computer and use it in GitHub Desktop.
delete.js
var delete_action_el = "btn primary-btn delete-action";
var delete_button_el = "js-actionDelete";
// Scroll
setInterval(function () {
window.scrollTo(0, document.body.scrollHeight);
}, 1000);
var _tweets = document.getElementsByClassName(delete_button_el);
var _doDelete = function () {
document.getElementsByClassName(delete_action_el)[0].click();
};
var _delete = function (i) {
setTimeout(function () {
_tweets[i].click();
_doDelete();
}, i * 1000);
};
var _start = function () {
for (var i in _tweets) {
try {
_delete(i);
} catch (e) {
_tweets = document.getElementsByClassName("js-actionDelete");
_start();
}
}
};
try {
_start();
} catch (e) {
_tweets = document.getElementsByClassName("js-actionDelete");
_start();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment