Created
February 10, 2025 19:35
-
-
Save 0x1ad2/6b526298bfd70756b1fbd5023da8fc6e to your computer and use it in GitHub Desktop.
π LinkedIn archiver
This file contains hidden or 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 to select all messages and click on them | |
function selectAllMessages() { | |
const items = document.querySelectorAll('.msg-selectable-entity__checkbox-circle-container'); | |
items.forEach(item => { | |
if (item instanceof HTMLElement) { | |
item.click(); | |
} | |
}); | |
} | |
// Function to click the Archive button | |
function clickArchiveButton() { | |
const archiveButton = document.querySelector('#ember232 > svg > use')?.parentElement?.parentElement; | |
if (archiveButton instanceof HTMLElement) { | |
archiveButton.click(); | |
} | |
} | |
// Main function to execute the actions with delays | |
function executeActions() { | |
selectAllMessages(); | |
setTimeout(() => { | |
clickArchiveButton(); | |
}, 2000); // Delay before clicking the Archive button | |
} | |
// Execute the actions every 4 seconds | |
const intervalId = setInterval(executeActions, 4000); | |
// Clear the interval after a certain condition or time | |
setTimeout(() => { | |
clearInterval(intervalId); | |
}, 60000); // Stops after 1 minute |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment