Skip to content

Instantly share code, notes, and snippets.

@mrThomasTeller
Last active September 29, 2017 09:41
Show Gist options
  • Save mrThomasTeller/c0c02d85a2a2df33eaaf3b265df10aa1 to your computer and use it in GitHub Desktop.
Save mrThomasTeller/c0c02d85a2a2df33eaaf3b265df10aa1 to your computer and use it in GitHub Desktop.
// friends
(async () => {
let replace = false;
do {
replace = false;
while (document.querySelector('[onclick*="Friends.declineRequest"]')) {
document.querySelector('[onclick*="Friends.declineRequest"]').click();
replace = true;
document.querySelector('.friends_user_row').remove();
const bl = document.querySelector('.friends_list_bl');
if (!bl.children.length) bl.remove();
if (!document.querySelector('[onclick*="Friends.declineRequest"]') && document.querySelector('#show_more')) document.querySelector('#show_more').click();
await new Promise(r => setTimeout(r, 200));
}
await new Promise(r => setTimeout(r, 3000));
} while (replace);
})();
// group decliners
(async () => {
let replace = false;
do {
replace = false;
while (document.querySelector('[onclick*="GroupsEdit.uAction"][onclick*="-1)"]')) {
document.querySelector('[onclick*="GroupsEdit.uAction"][onclick*="-1)"]').click();
replace = true;
document.querySelector('.group_l_row').remove();
if (!document.querySelector('[onclick*="GroupsEdit.uAction"][onclick*="-1)"]') && document.querySelector('#group_edit_more_declined')) document.querySelector('#group_edit_more_declined').click();
await new Promise(r => setTimeout(r, 200));
}
await new Promise(r => setTimeout(r, 3000));
} while (replace);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment