Last active
February 13, 2023 17:16
-
-
Save skobkin/ae1b30468ff94bdd1c01e6153aa32639 to your computer and use it in GitHub Desktop.
Removing all visible posts from VK.com profile
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
// 1. Scroll down your profile page as much as you can | |
// 2. Selecting "Delete" links (for English localization). It will not work on Russian language unless you change this: link.textContent === 'Delete post' | |
let links = [...document.querySelectorAll('a.ui_actions_menu_item')].filter(link => link.textContent === 'Delete post'); | |
// 3. Removing last N posts if you want to keep them. One comma for each of RECENT posts to be left undeleted. | |
let [,,,,,,,,,,,,, ...removeLinks] = links; | |
// 4. Extracting wall.deletePost() calls | |
let codes = removeLinks.map(element => element.getAttribute('onclick')); | |
// 5. Calling them each 1000 milliseconds | |
codes.forEach(code => setTimeout(function() {eval(code)}, 1000)); | |
// 6. Reload page | |
// 7. Repeat for any remaining posts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment