Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (async function autoDeclinePosts() {
- function delay(ms) {
- return new Promise(resolve => setTimeout(resolve, ms));
- }
- async function scrollToBottom() {
- return new Promise(resolve => {
- let distance = 2000; // Scroll distance in pixels
- let interval = 25; // Time between scrolls in ms
- let scrollCount = 0;
- const scrollInterval = setInterval(() => {
- window.scrollBy(0, distance);
- scrollCount++;
- console.log(`Scrolled ${scrollCount * distance}px`);
- // Stop scrolling if the bottom of the page is reached
- if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) {
- clearInterval(scrollInterval);
- resolve();
- }
- }, interval);
- });
- }
- async function declinePosts() {
- while (true) {
- // Select all visible decline buttons
- const buttons = document.querySelectorAll('[aria-label="Decline"]'); // Adjust selector if needed
- if (buttons.length === 0) {
- console.log("No more decline buttons found on this section.");
- await scrollToBottom(); // Scroll down to load more posts
- await delay(500); // Minimal delay to allow new posts to load
- continue; // Check for new buttons
- }
- console.log(`Found ${buttons.length} posts to decline.`);
- // Click all visible decline buttons in rapid succession
- buttons.forEach(button => button.click());
- console.log("All visible posts declined.");
- await delay(250); // Very short delay to avoid overwhelming the page
- }
- }
- console.log("Starting ultra-fast auto-decline process...");
- await declinePosts();
- console.log("Auto-decline process completed.");
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement