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 delay(n) { | |
return new Promise(accept => setTimeout(() => accept(), n)); | |
} | |
async function cleanUp() { | |
let xs = Array.from(document.querySelectorAll('[aria-label=Edit]')).slice(0, 10); | |
console.log(xs); | |
xs.forEach(n => n.click()); | |
await delay(1000); | |
let ys = document.querySelectorAll('[rel=async-post][ajaxify^="/ajax/timeline/delete/confirm"]'); | |
console.log(ys); | |
ys.forEach(n => n.click()); | |
await delay(5000); | |
for (let n of document.querySelectorAll('form[action^="/ajax/timeline/delete"] [type=submit]')) { | |
n.click(); | |
await delay(500); | |
} | |
for (let x of xs) { | |
document.querySelector(`[data-ownerid=${x.id}]`).remove(); | |
x.remove(); | |
} | |
document.querySelectorAll('.uiLayer').forEach(n => n.remove()); | |
window.scrollTo(0, document.body.scrollHeight); | |
await delay(1000); | |
let loader = document.querySelector('[ajaxify^="/ajax/timeline/all_activity/scroll.php"]'); | |
if (loader) loader.click(); | |
await delay(1000); | |
await cleanUp(); | |
} | |
cleanUp(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment