Skip to content

Instantly share code, notes, and snippets.

@hurelhuyag
Created October 16, 2019 12:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hurelhuyag/12c5e2a9287f66c2183f7a04cb0b828e to your computer and use it in GitHub Desktop.
Save hurelhuyag/12c5e2a9287f66c2183f7a04cb0b828e to your computer and use it in GitHub Desktop.
fb_group_pending_post_cleaner.js
(function () {
setInterval(function(){
window.scrollBy(0, 100);
}, 1850);
function delConfirm() {
var el = $('button.layerConfirm');
if (el.length) {
console.log('confirm:', el);
el.click();
setTimeout(delOne, 3000);
} else {
console.log('waiting confirm btn');
setTimeout(delConfirm, 1000);
}
}
var clickFired = false;
function checkClick(){
if(!clickFired){
console.log('click is not fired. retrying');
delOne();
}
}
function delOne() {
var el = $('a:contains(Decline):first em');
if(!el.length){
console.log('del missing. waiting another');
setTimeout(delOne, 5000);
}else{
console.log('del:', el);
el.click();
setTimeout(delConfirm, 1200);
//setTimeout(checkClick, 2000);
}
}
delOne();
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment