// ==UserScript== // @name Bing Rewards Lite (Win & Mac) // @version 1.1 // @description 自动搜索热榜词刷积分(桌面 40 / 手机 30);兼容新版 Bing / Copilot Search // @match https://*.bing.com/* // @match https://*.bing.cn/* // @grant GM_getValue // @grant GM_setValue // @grant GM_addStyle // @grant GM_xmlhttpRequest // @grant GM_setTimeout // @grant GM_clearTimeout // @grant GM_setInterval // @grant GM_clearInterval // @connect api-hot.imsyy.top // @license MIT // @namespace https://greasyfork.org/users/737649 // @downloadURL none // ==/UserScript== (function () { /* ===== 基本配置 ===== */ const ID = 'bru_panel'; // 面板 DOM id(保持 ASCII,避免跨浏览器问题) const VER = '1.1'; const MAX = { pc: 40, ph: 30 }; // 每日积分上限 const TYPE = { min: 35, max: 80 }; // 模拟打字速度区间 (ms) const SCROLL_TIMES = 4; // 搜索前随机滚动次数 const FALL = ['今日新闻','天气预报','电影票房','体育比分','股票行情']; // 热榜兜底词 /* ===== 兼容新版 Bing 选择器 ===== */ const SELECTORS = [ '#sb_form_q', // 旧版桌面 '.b_searchbox', // 旧版结果页 'input[name="q"]', // 通用 '#searchboxinput', // 新版 Copilot 搜索栏 'textarea[name="q"]' // Copilot 侧栏 / 超窄视图 ]; /* ===== 通用工具 ===== */ const tSet = typeof GM_setTimeout === 'function' ? GM_setTimeout : setTimeout; const tClr = typeof GM_clearTimeout === 'function' ? GM_clearTimeout : clearTimeout; const iSet = typeof GM_setInterval === 'function' ? GM_setInterval : setInterval; const iClr = typeof GM_clearInterval=== 'function' ? GM_clearInterval: clearInterval; const z2 = n => (n < 10 ? '0' : '') + n; /* ===== 状态记录 ===== */ const today = new Date().toISOString().slice(0, 10); const def = { date: today, pc: 0, ph: 0, running: true }; let rec = GM_getValue('bru_lite', def); if (rec.date !== today) { rec = { ...def }; GM_setValue('bru_lite', rec); } const mobile = /mobile|android|iphone|ipad|touch/i.test(navigator.userAgent); const key = mobile ? 'ph' : 'pc'; const limit = mobile ? MAX.ph : MAX.pc; /* ===== 热榜词 ===== */ let HOT = []; function fetchHot() { return new Promise(done => { GM_xmlhttpRequest({ method: 'GET', url: 'https://api-hot.imsyy.top/baidu?num=50', onload: ({ responseText }) => { try { HOT = JSON.parse(responseText).data.map(x => x.title).filter(Boolean); } catch { HOT = []; } if (!HOT.length) HOT = FALL; done(); }, onerror: () => { HOT = FALL; done(); } }); }); } /* ===== 样式 ===== */ GM_addStyle(` #${ID}{ position:fixed;top:10px;right:10px;z-index:99999;width:190px;padding:10px 10px 8px 10px; font:11px/1.45 system-ui,-apple-system,BlinkMacSystemFont,sans-serif; color:#222;background:rgba(255,255,255,.55);backdrop-filter:blur(12px) saturate(1.4); border-radius:10px;box-shadow:0 4px 12px rgba(0,0,0,.18);overflow:visible; } #${ID} button{ all:unset;font-size:10px;background:#3b82f6;color:#fff;border-radius:5px; padding:3px 8px;margin-left:4px;cursor:pointer } .bar{height:4px;background:#d0d0d0;border-radius:3px;overflow:hidden;margin-top:3px} .fill{ height:100%;width:100%; background:linear-gradient(90deg,#00b7ff,#00ffb7,#d4ff00,#ff6600,#ff00aa,#00b7ff); background-size:400% 100%;transform-origin:left; transition:transform .6s ease;animation:flow 5s linear infinite } @keyframes flow{0%{background-position:0 0}100%{background-position:100% 0}} .err{display:none;color:#e63946;font-weight:600;margin-top:2px;font-size:10px} .decor{ position:absolute;right:4px;top:46px;width:32px;height:32px;border-radius:50%; background:conic-gradient(#00b7ff,#00ffb7,#d4ff00,#ff6600,#ff00aa,#00b7ff); animation:spin 7s linear infinite,pulse 3.5s ease-in-out infinite alternate; pointer-events:none;opacity:.75;filter:blur(1px) drop-shadow(0 0 4px rgba(0,0,0,.12)); } @keyframes spin{to{transform:rotate(360deg)}} @keyframes pulse{from{transform:scale(.9)}to{transform:scale(1.05)}} `); /* ===== 面板 ===== */ function buildPanel() { if (document.getElementById(ID)) return; const box = document.createElement('div'); box.id = ID; box.innerHTML = `