Random Search Generator for Microsoft Rewards

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

  1. // ==UserScript==
  2. // @name Random Search Generator for Microsoft Rewards
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Generates random searches and enters them into the Bing search bar on the Microsoft Rewards homepage
  6. // @author You
  7. // @match https://www.bing.com/*
  8. // @grant none
  9. // @license AL
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. setInterval(function() {
  16. // Generate a random search query
  17. var search = generateRandomSearch();
  18. // Enter the search query into the Bing search bar
  19. document.getElementById("sb_form_q").value = search;
  20. // Submit the search
  21. document.getElementById("sb_form").submit();
  22. }, 500); // .5 seconds
  23.  
  24. function generateRandomSearch() {
  25. var search = "";
  26. // Generate a random string of 8 characters
  27. for (var i = 0; i < 8; i++) {
  28. // Generate a random number between 0 and 1
  29. var r = Math.random();
  30. // If the number is less than 0.5, add a random letter (A-Z) to the search string
  31. if (r < 0.5) {
  32. search += String.fromCharCode(Math.floor(Math.random() * 26) + 65);
  33. }
  34. // Otherwise, add a random number (0-9) to the search string
  35. else {
  36. search += Math.floor(Math.random() * 10);
  37. }
  38. }
  39. return search;
  40. }
  41. })();