Skip to content

Instantly share code, notes, and snippets.

@egeste
Created November 18, 2024 19:44
Show Gist options
  • Save egeste/324b2448b7dae5e27adfe2c2c1605b2b to your computer and use it in GitHub Desktop.
Save egeste/324b2448b7dae5e27adfe2c2c1605b2b to your computer and use it in GitHub Desktop.
Delete your instagram posts - sloppy, but it works
USERNAME="insert_username_here"
const delete_next_post = () => {
document.querySelector(`[href^="/${USERNAME}/p/"]`).click()
setTimeout(() => {
document.querySelector('svg[aria-label="More options"]').parentElement.parentElement.parentElement.click()
setTimeout(() => {
document.querySelectorAll('[role=dialog] button').entries().find(([i, n]) => n.innerText === 'Delete')[1].click()
setTimeout(() => {
document.querySelectorAll('[role=dialog] button').entries().find(([i, n]) => n.innerText === 'Delete')[1].click()
setTimeout(() => {
if (document.querySelector(`[href^="/${USERNAME}/p/"]`)) {
delete_next_post()
}
}, 5000)
}, 1000)
}, 1000)
}, 1000)
}
delete_next_post()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment