Skip to content

Instantly share code, notes, and snippets.

@0x1ad2
Created February 10, 2025 19:35
Show Gist options
  • Save 0x1ad2/6b526298bfd70756b1fbd5023da8fc6e to your computer and use it in GitHub Desktop.
Save 0x1ad2/6b526298bfd70756b1fbd5023da8fc6e to your computer and use it in GitHub Desktop.
πŸ“ LinkedIn archiver
// 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