Random Search Generator for Microsoft Rewards

Generates random searches and enters them into the Bing search bar on the Microsoft Rewards homepage

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name       Random Search Generator for Microsoft Rewards
// @namespace  http://tampermonkey.net/
// @version    0.1
// @description  Generates random searches and enters them into the Bing search bar on the Microsoft Rewards homepage
// @author     You
// @match      https://www.bing.com/*
// @grant      none
// @license AL 
// ==/UserScript==

(function() {
    'use strict';

        setInterval(function() {
            // Generate a random search query
            var search = generateRandomSearch();
            // Enter the search query into the Bing search bar
            document.getElementById("sb_form_q").value = search;
            // Submit the search
            document.getElementById("sb_form").submit();
        }, 500); // .5 seconds

    function generateRandomSearch() {
        var search = "";
        // Generate a random string of 8 characters
        for (var i = 0; i < 8; i++) {
            // Generate a random number between 0 and 1
            var r = Math.random();
            // If the number is less than 0.5, add a random letter (A-Z) to the search string
            if (r < 0.5) {
                search += String.fromCharCode(Math.floor(Math.random() * 26) + 65);
            }
            // Otherwise, add a random number (0-9) to the search string
            else {
                search += Math.floor(Math.random() * 10);
            }
        }
        return search;
    }
})();