Last active
January 19, 2024 18:33
-
-
Save Vlasterx/b244b9b27ade8a6dd7eb2ffd3aae8d99 to your computer and use it in GitHub Desktop.
Delete all LinkedIn posts version for June 2021.
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
(() => { | |
let speedMs = 500 | |
setInterval(() => { | |
let dropdown = document.querySelector('.feed-shared-update-v2__control-menu .artdeco-dropdown button') | |
dropdown.click() | |
setTimeout(() => { | |
let optionDel = dropdown.parentElement.parentElement.parentElement.querySelector('.option-delete .tap-target') | |
if (optionDel === null) { | |
setTimeout(() => { window.scrollTo(0,document.body.scrollHeight) }, speedMs * 4) | |
} else { | |
optionDel.click() | |
setTimeout(() => { | |
document.querySelector('.artdeco-modal .feed-shared-decision-modal__confirm-button').click() | |
}, speedMs) | |
} | |
}, speedMs) | |
}, speedMs) | |
})() |
This is minified code for the bookmarklet. Create new bookmark and copy this code to URL, then click on it on profile > see all activity > posts
page
javascript:(()=>{let speedMs=500;setInterval(()=>{let dropdown=document.querySelector('.feed-shared-update-v2__control-menu .artdeco-dropdown button');dropdown.click();setTimeout(()=>{let optionDel=dropdown.parentElement.parentElement.parentElement.querySelector('.option-delete .tap-target');if(optionDel===null){setTimeout(()=>{window.scrollTo(0,document.body.scrollHeight)},speedMs*4)}else{optionDel.click();setTimeout(()=>{document.querySelector('.artdeco-modal .feed-shared-decision-modal__confirm-button').click()},speedMs)}},speedMs)},speedMs)})();
Works like a charm, thanks ! Could you add a refresh function or a click on the "Show more results" button after X iterations ?
2023 updated version
(() => {
let speedMs = 500
setInterval(() => {
let dropdown = document.querySelector('.feed-shared-update-v2__control-menu .artdeco-dropdown button')
dropdown.click()
setTimeout(() => {
let optionDel = dropdown.parentElement.parentElement.parentElement.querySelector('.option-delete .tap-target')
if (optionDel === null) {
// setTimeout(() => { window.scrollTo(0,document.body.scrollHeight) }, speedMs * 4)
} else {
optionDel.click()
setTimeout(() => {
document.querySelector('.artdeco-modal .feed-components-shared-decision-modal__confirm-button').click()
}, speedMs)
}
}, speedMs)
}, speedMs)
})()
Having to click the delete button each time for the post to remove. One click is much better then the alternative. Thank you
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Open your LinkedIn profile, find
See all activity
, click onposts
, open developer tools with F12, find console, paste the code above and press enter.