Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let rejectedCount = 0;
- let consecutiveErrors = 0;
- let connectionErrorCount = 0;
- async function autoDecline() {
- while (true) {
- try {
- // Cari semua tombol dengan teks 'Decline'
- let buttons = Array.from(document.querySelectorAll("span"))
- .filter(el => el.textContent.trim() === "Decline");
- if (buttons.length <= 1) {
- console.log("No more posts to decline, checking again in 5 minutes...");
- await new Promise(r => setTimeout(r, 300000)); // 5 menit
- location.reload(); // Refresh halaman
- continue;
- }
- for (let btn of buttons) {
- try {
- btn.click();
- rejectedCount++;
- console.log(`Post #${rejectedCount} rejected.`);
- consecutiveErrors = 0;
- connectionErrorCount = 0;
- await new Promise(r => setTimeout(r, 1000)); // delay 1 detik antar klik
- } catch (err) {
- console.error("Rejection failed:", err);
- continue;
- }
- }
- // Scroll sedikit ke bawah untuk memuat lebih banyak postingan
- await new Promise(r => setTimeout(r, 5000));
- window.scrollBy(0, 500);
- } catch (err) {
- consecutiveErrors++;
- console.error("Error:", err);
- if (consecutiveErrors >= 3) {
- console.error("Encountered 3 consecutive errors, stopping the script.");
- break;
- }
- await new Promise(r => setTimeout(r, 10000)); // tunggu 10 detik
- location.reload();
- }
- }
- }
- autoDecline();
Add Comment
Please, Sign In to add comment