Microsoft(Bing) Rewards Script

自动获得微软(Microsoft Rewards)/必应奖励(Bing Rewards)。通过设置搜索次数,🤖自动搜索获取积分。支持获得✔电脑搜索🏆、✔移动端搜索🏅、✔Microsoft Edge 奖励✌三种奖励

  1. // ==UserScript==
  2. // @name Microsoft(Bing) Rewards Script
  3. // @namespace 3hex
  4. // @version 0.6.1
  5. // @description 自动获得微软(Microsoft Rewards)/必应奖励(Bing Rewards)。通过设置搜索次数,🤖自动搜索获取积分。支持获得✔电脑搜索🏆、✔移动端搜索🏅、✔Microsoft Edge 奖励✌三种奖励
  6. // @author 3hex
  7. // @match https://www.bing.com/*
  8. // @match https://cn.bing.com/*
  9. // @icon https://az15297.vo.msecnd.net/images/rewards/membercenter/missions/Animated-Icons/bing_icon.svg
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. var currentURL = window.location.href;
  18. var domain = new URL(currentURL).hostname;
  19.  
  20. function getMobileViewport(width, height) {
  21. return {
  22. width: width,
  23. height: height,
  24. deviceScaleFactor: 1,
  25. mobile: true
  26. };
  27. }
  28.  
  29. var num = 0;
  30. var mode = 0 // 0:PC 1:mobile
  31.  
  32. console.log("[info] successful match");
  33.  
  34. const timestamp = new Date().getTime(); // 获取当前时间戳
  35. console.log("[info] timestamp:"+timestamp); // 输出当前时间戳
  36.  
  37. const div = document.createElement('div');
  38. const img = document.createElement('img');
  39. const span = document.createElement('span')
  40.  
  41. div.appendChild(img);
  42. div.appendChild(span);
  43.  
  44. img.src = 'https://az15297.vo.msecnd.net/images/rewards/membercenter/missions/Animated-Icons/bing_icon.svg'; // 设置 img 的 src 属性
  45.  
  46. img.id = "mrs_img_auto";
  47. div.style.position = 'fixed'; // 设置定位方式为固定定位
  48. div.style.top = '15%'; // 设置 img 的上边缘距离屏幕顶部的距离为 0
  49. div.style.left = '3%'; // 设置 img 的左边缘距离屏幕左侧的距离为 0
  50.  
  51. span.textContent = "0";
  52. span.style.color = "red";
  53. span.style.fontWeight = 'bold';
  54. span.style.display = 'flex';
  55. span.style.alignItems = 'center';
  56. span.style.justifyContent = 'center';
  57.  
  58. num = parseInt(localStorage.getItem('mrs_count_num'), 10);
  59. mode = parseInt(localStorage.getItem('mrs_count_mode'), 10);
  60. if(!isNaN(num)&&num!=0)
  61. {
  62. span.textContent = ""+num;
  63. console.log("[info] count:"+num);
  64. num = num - 1;
  65. localStorage.setItem('mrs_count_num',num);
  66.  
  67. const url = "https://" + domain + "/search?q="+timestamp; // 目标网页的地址
  68. window.open(url, "_self"); // 在当前页面中打开目标网页
  69. }
  70.  
  71. div.addEventListener('click', function() { // 添加点击事件监听器
  72. const n = window.prompt('Please enter a number(Number of searches):');
  73. num = parseInt(n, 10);
  74. if(!isNaN(num)&&num!=0) {
  75. span.textContent = ""+num;
  76. console.log("[info] first count:"+num);
  77. num = num - 1;
  78.  
  79. localStorage.setItem('mrs_count_num',num);
  80.  
  81. const url = "https://cn.bing.com/search?q="+timestamp; // 目标网页的地址
  82. window.open(url, "_self"); // 在当前页面中打开目标网页
  83.  
  84. }else
  85. {
  86. console.log("[info] cancel");
  87. }
  88. });
  89. document.getElementById('b_content').appendChild(div);
  90.  
  91. // 监听键盘按键事件
  92. document.addEventListener('keydown', function(event) {
  93. if (event.ctrlKey && event.altKey && event.key === 'l') {
  94. if (confirm("Whether you want to stop automatic search? ")) {
  95. console.log("[info] stop");
  96. num = 0;
  97. localStorage.setItem('mrs_count_num',0);;
  98. } else {
  99. console.log("[info] continue :) ");
  100. }
  101. }
  102. });
  103.  
  104. })();
  105.