移动端微软Rewards每日任务脚本

盒马卡,加油卡,电影卡,天猫卡,山姆卡通通都有。

目前為 2024-09-30 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name 移动端微软Rewards每日任务脚本
  3. // @version 2024.9.30
  4. // @description 盒马卡,加油卡,电影卡,天猫卡,山姆卡通通都有。
  5. // @author 怀沙2049
  6. // @match https://*.bing.com/*
  7. // @license GNU GPLv3
  8. // @icon https://www.bing.com/favicon.ico
  9. // @connect gumengya.com
  10. // @run-at document-end
  11. // @note 更新于 2024年9月30日
  12. // @supportURL https://gf.qytechs.cn/zh-CN/users/1192640-huaisha1224
  13. // @homepageURL https://gf.qytechs.cn/zh-CN/users/1192640-huaisha1224
  14. // @grant GM_registerMenuCommand
  15. // @grant GM_addStyle
  16. // @grant GM_openInTab
  17. // @grant GM_setValue
  18. // @grant GM_getValue
  19. // @grant GM_xmlhttpRequest
  20. // @namespace https://gf.qytechs.cn/zh-CN/users/1192640-huaisha1224
  21. // ==/UserScript==
  22.  
  23. var max_rewards = 30; //重复执行的次数
  24. //每执行4次搜索后插入暂停时间,解决账号被监控不增加积分的问题
  25. var pause_time = 9; // 暂停时长建议为16分钟,也就是960000(60000毫秒=1分钟)
  26. var search_words = []; //搜索词
  27. var default_search_words = ["盛年不重来,一日难再晨", "千里之行,始于足下", "少年易学老难成,一寸光阴不可轻", "敏而好学,不耻下问", "海内存知已,天涯若比邻", "三人行,必有我师焉",
  28. "莫愁前路无知已,天下谁人不识君", "人生贵相知,何用金与钱", "天生我材必有用", "海纳百川有容乃大;壁立千仞无欲则刚", "穷则独善其身,达则兼济天下", "读书破万卷,下笔如有神",
  29. "学而不思则罔,思而不学则殆", "一年之计在于春,一日之计在于晨", "莫等闲,白了少年头,空悲切", "少壮不努力,老大徒伤悲", "一寸光阴一寸金,寸金难买寸光阴", "近朱者赤,近墨者黑",
  30. "吾生也有涯,而知也无涯", "纸上得来终觉浅,绝知此事要躬行", "学无止境", "己所不欲,勿施于人", "天将降大任于斯人也", "鞠躬尽瘁,死而后已", "书到用时方恨少", "天下兴亡,匹夫有责",
  31. "人无远虑,必有近忧", "为中华之崛起而读书", "一日无书,百事荒废", "岂能尽如人意,但求无愧我心", "人生自古谁无死,留取丹心照汗青", "吾生也有涯,而知也无涯", "生于忧患,死于安乐"]
  32. //{weibohot}微博热搜榜/{bilihot}哔哩热搜榜/{douyinhot}抖音热搜榜/{zhihuhot}知乎热搜榜/{baiduhot}百度热搜榜
  33.  
  34. var keywords_source = ['ZhiHuHot','WeiBoHot','TouTiaoHot','DouYinHot', 'BaiduHot'];
  35. var random_keywords_source = keywords_source[Math.floor(Math.random() * keywords_source.length)]
  36. //每次运行时随机获取一个热门搜索词来源用来作为关键词
  37. function douyinhot_dic() {
  38. return new Promise((resolve, reject) => {
  39. // 发送GET请求到指定URL
  40. fetch("https://api.gumengya.com/Api/" + random_keywords_source)
  41. .then(response => response.json()) // 将返回的响应转换为JSON格式
  42. .then(data => {
  43. if (data.data.some(item => item)) {
  44. // 提取每个元素的name属性值
  45. const names = data.data.map(item => item.title);
  46. resolve(names); // 将name属性值作为Promise对象的结果返回
  47. } else {
  48. //如果为空使用默认搜索词
  49. resolve(default_search_words)
  50. }
  51. })
  52. .catch(error => {
  53. // 如果请求失败,则返回默认搜索词
  54. resolve(default_search_words)
  55. reject(error); // 将错误信息作为Promise对象的错误返回
  56. });
  57. });
  58. }
  59. // 调用douyinhot_dic函数,获取names列表
  60. douyinhot_dic()
  61. .then(names => {
  62. // console.log(names[0]);
  63. search_words = names;
  64. exec()
  65. })
  66. .catch(error => {
  67. console.error(error);
  68. });
  69.  
  70. // 定义菜单命令:开始
  71. let menu1 = GM_registerMenuCommand('开始', function () {
  72. GM_setValue('Cnt', 0); // 将计数器重置为0
  73. location.href = "https://www.bing.com/?br_msg=Please-Wait"; // 跳转到Bing首页
  74. }, 'o');
  75.  
  76. // 定义菜单命令:停止
  77. let menu2 = GM_registerMenuCommand('停止', function () {
  78. GM_setValue('Cnt', max_rewards + 10); // 将计数器设置为超过最大搜索次数,以停止搜索
  79. }, 'o');
  80.  
  81.  
  82. // 生成指定长度的包含大写字母、数字的随机字符串
  83. function generateRandomString(length) {
  84. const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
  85. let result = '';
  86. const charactersLength = characters.length;
  87. for (let i = 0; i < length; i++) {
  88. // 从字符集中随机选择字符,并拼接到结果字符串中
  89. result += characters.charAt(Math.floor(Math.random() * charactersLength));
  90. }
  91. return result;
  92. }
  93.  
  94. function exec() {
  95. // 生成随机延迟时间
  96. let randomDelay = Math.floor(Math.random() * 20000) + 10000; // 生成10秒到30秒之间的随机数
  97. let randomString = generateRandomString(4); //生成4个长度的随机字符串
  98. let randomCvid = generateRandomString(32); //生成32位长度的cvid
  99. 'use strict';
  100.  
  101. // 检查计数器的值,若为空则设置为超过最大搜索次数
  102. if (GM_getValue('Cnt') == null) {
  103. GM_setValue('Cnt', max_rewards + 10);
  104. }
  105.  
  106. // 获取当前搜索次数
  107. let currentSearchCount = GM_getValue('Cnt');
  108. // 根据计数器的值选择搜索引擎
  109. if (currentSearchCount <= max_rewards / 2) {
  110. let tt = document.getElementsByTagName("title")[0];
  111. tt.innerHTML = "[" + currentSearchCount + " / " + max_rewards + "] " + tt.innerHTML; // 在标题中显示当前搜索次数
  112. smoothScrollToBottom(); // 添加执行滚动页面到底部的操作
  113. GM_setValue('Cnt', currentSearchCount + 1); // 将计数器加1
  114. setTimeout(function () {
  115. let nowtxt = search_words[currentSearchCount]; // 获取当前搜索词
  116.  
  117. // 检查是否需要暂停
  118. if ((currentSearchCount + 1) % 5 === 0) {
  119. // 暂停指定时长
  120. setTimeout(function() {
  121. location.href = "https://www.bing.com/search?q=" + encodeURI(nowtxt) + "&form=" + randomString + "&cvid=" + randomCvid; // 在Bing搜索引擎中搜索
  122. }, pause_time);
  123. } else {
  124. location.href = "https://www.bing.com/search?q=" + encodeURI(nowtxt) + "&form=" + randomString + "&cvid=" + randomCvid; // 在Bing搜索引擎中搜索
  125. }
  126. }, randomDelay);
  127. } else if (currentSearchCount > max_rewards / 2 && currentSearchCount < max_rewards) {
  128. let tt = document.getElementsByTagName("title")[0];
  129. tt.innerHTML = "[" + currentSearchCount + " / " + max_rewards + "] " + tt.innerHTML; // 在标题中显示当前搜索次数
  130. smoothScrollToBottom(); // 添加执行滚动页面到底部的操作
  131. GM_setValue('Cnt', currentSearchCount + 1); // 将计数器加1
  132. setTimeout(function () {
  133. let nowtxt = search_words[currentSearchCount]; // 获取当前搜索词
  134.  
  135. // 检查是否需要暂停
  136. if ((currentSearchCount + 1) % 5 === 0) {
  137. // 暂停指定时长
  138. setTimeout(function() {
  139. location.href = "https://cn.bing.com/search?q=" + encodeURI(nowtxt) + "&form=" + randomString + "&cvid=" + randomCvid; // 在Bing搜索引擎中搜索
  140. }, pause_time);
  141. } else {
  142. location.href = "https://cn.bing.com/search?q=" + encodeURI(nowtxt) + "&form=" + randomString + "&cvid=" + randomCvid; // 在Bing搜索引擎中搜索
  143. }
  144. }, randomDelay);
  145. }
  146. // 实现平滑滚动到页面底部的函数
  147. function smoothScrollToBottom() {
  148. document.documentElement.scrollIntoView({ behavior: 'smooth', block: 'end' });
  149. }
  150. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址