Greasy Fork

Greasy Fork is available in English.

Hide Low Reward Swagbucks Surveys

Hide surveys on Swagbucks that offer a reward below a set amount

当前为 2024-10-19 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Hide Low Reward Swagbucks Surveys
// @namespace    http://tampermonkey.net/
// @version      2024-10-19
// @description  Hide surveys on Swagbucks that offer a reward below a set amount
// @author       LordBunzo (www.reddit.com/u/LordBunzo)
// @license      MIT
// @match        https://www.swagbucks.com/surveys*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=swagbucks.com
// @grant        GM_log
// ==/UserScript==

(function() {
    'use strict';

    const MINIMUM_REWARD = 75; // Change this value to your preferred minimum reward
    const REFRESH_BUTTON_SELECTOR = '#surveysRefreshWarning';
    const SURVEY_SELECTOR = '#surveyList > tbody > tr';
    const REWARD_SELECTOR = '.surveySB > span > var'

    function hideLowRewardSurveys() {
        const surveys = document.querySelectorAll(SURVEY_SELECTOR);
        surveys.forEach(survey => {
            const rewardElement = survey.querySelector(REWARD_SELECTOR);
            if (rewardElement) {
                const rewardText = rewardElement.textContent;

                const rewardValue = parseInt(rewardText.replace(/\D/g,''), 10); // strip non-numeric characters

                if (rewardValue < MINIMUM_REWARD) {
                    survey.style.display = 'none'; // Hide the survey
                }
            }

        });
        console.log('%d Low reward survey(s) hidden.', surveys.length);
    }

    function clickRefreshButtonIfFound() {
        const refreshBtn = document.querySelector(REFRESH_BUTTON_SELECTOR);
        if (refreshBtn) {
            refreshBtn.click();
            // Wait for 5 seconds after clicking before processing surveys
            setTimeout(hideLowRewardSurveys, 5000);
        } else {
            // No refresh button, proceed with hiding low reward surveys
            hideLowRewardSurveys();
        }

    }

    // Update every 3 sec, adjust as necessary
    setInterval(clickRefreshButtonIfFound, 3000);
})();