Created
October 16, 2019 12:03
-
-
Save hurelhuyag/12c5e2a9287f66c2183f7a04cb0b828e to your computer and use it in GitHub Desktop.
fb_group_pending_post_cleaner.js
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 () { | |
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