当前位置: 首页 > news >正文

BOSS直接自动点击未读消息并发送求简历请求

最新版本代码 26-04-23 修复没有对话无法发送求简历按钮

(() => { /****************************************************************** * 可配置参数 ******************************************************************/ const CONFIG = { countdownSeconds: 3, openConfirmDelayMs: 300, requestResultTimeoutMs: 5000, switchConversationDelayMs: 1000, listScrollStep: 700, pollIntervalMs: 200, uniqueNames: false, maxShowNames: 300, enablePeriodicRefresh: true, refreshEveryConversationCount: 40, refreshTabKeyword: "新招呼", refreshAfterClickDelayMs: 800, // 灰色“求简历”但未请求时,直接模拟输入的文案 manualUnlockMessageText: "可以发一份简历看看吗", // 模拟发送后,先等 1 秒 manualUnlockWaitAfterSendMs: 1000, // 发送后等待“求简历”解锁的最长时间 manualUnlockTimeoutMs: 5000, sameNameLoopLimit: 2 }; /****************************************************************** * 如果旧脚本存在,先停掉 ******************************************************************/ if (window.__bossResumeBot && typeof window.__bossResumeBot.stop === "function") { try { window.__bossResumeBot.stop(); } catch (e) {} } /****************************************************************** * 全局状态 ******************************************************************/ const state = { running: true, paused: false, stopRequested: false, requestedCount: 0, requestedRecords: [], countdown: 0, status: "初始化中...", phase: "idle", currentName: "", panel: null, processedConversationCount: 0, lastRefreshAtProcessedCount: 0, lastSwitchedName: "", sameNameHitCount: 0 }; class StopError extends Error { constructor(message = "脚本已停止") { super(message); this.name = "StopError"; } } /****************************************************************** * 基础工具函数 ******************************************************************/ function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } function textOf(el) { return (el?.textContent || "").replace(/\s+/g, " ").trim(); } function normalizeText(str) { return String(str ?? "").replace(/\s+/g, " ").trim(); } function qs(selector, root = document) { return root.querySelector(selector); } function qsa(selector, root = document) { return [...root.querySelectorAll(selector)]; } function visible(el) { if (!el) return false; const style = getComputedStyle(el); const rect = el.getBoundingClientRect(); return ( style.display !== "none" && style.visibility !== "hidden" && rect.width > 0 && rect.height > 0 ); } function click(el) { if (!el) return false; el.dispatchEvent( new MouseEvent("click", { bubbles: true, cancelable: true, view: window }) ); return true; } function escapeHtml(str) { return String(str ?? "") .replaceAll("&", "&amp;") .replaceAll("<", "&lt;") .replaceAll(">", "&gt;") .replaceAll('"', "&quot;") .replaceAll("'", "&#39;"); } function excelCell(str) { return escapeHtml(String(str ?? "")).replace(/\n/g, "<br>"); } function nowString() { const d = new Date(); const y = d.getFullYear(); const m = String(d.getMonth() + 1).padStart(2, "0"); const day = String(d.getDate()).padStart(2, "0"); const h = String(d.getHours()).padStart(2, "0"); const min = String(d.getMinutes()).padStart(2, "0"); const s = String(d.getSeconds()).padStart(2, "0"); return `${y}-${m}-${day} ${h}:${min}:${s}`; } function pickFirst(arr = [], matcher) { return arr.find(item => matcher(item)) || ""; } /****************************************************************** * 运行控制 ******************************************************************/ function guardRunning() { if (!state.running || state.stopRequested) { throw new StopError(); } } async function interruptibleSleep(ms) { let elapsed = 0; while (elapsed < ms) { guardRunning(); while (state.paused) { state.phase = "paused"; renderPanel(); await sleep(CONFIG.pollIntervalMs); guardRunning(); } const step = Math.min(CONFIG.pollIntervalMs, ms - elapsed); await sleep(step); elapsed += step; } } function pauseRunner() { if (!state.running) return; state.paused = true; state.phase = "paused"; state.status = "已暂停"; renderPanel(); } function resumeRunner() { if (!state.running) return; state.paused = false; state.phase = "idle"; state.status = "继续运行中..."; renderPanel(); } function stopRunner() { state.stopRequested = true; state.running = false; state.paused = false; state.countdown = 0; state.phase = "stopped"; state.status = "已停止"; renderPanel(); } /****************************************************************** * 面板 ******************************************************************/ function createPanel() { const old = document.getElementById("__boss_resume_panel"); if (old) old.remove(); const panel = document.createElement("div"); panel.id = "__boss_resume_panel"; panel.style.cssText = ` position: fixed; top: 16px; right: 16px; z-index: 999999; width: 390px; max-height: 82vh; overflow: hidden; background: rgba(15, 23, 42, 0.95); color: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.28); font: 14px/1.6 Arial, sans-serif; user-select: text; border: 1px solid rgba(255,255,255,0.1); `; panel.addEventListener("click", (e) => { const act = e.target?.dataset?.act; if (!act) return; if (act === "pause") pauseRunner(); if (act === "resume") resumeRunner(); if (act === "stop") stopRunner(); if (act === "export") exportRequestedToExcel(); }); document.body.appendChild(panel); return panel; } function renderPanel() { if (!state.panel) return; const list = state.requestedRecords.slice(0, CONFIG.maxShowNames); const listHtml = list.length ? list.map(item => ` <div style="padding:4px 0; border-bottom:1px dashed rgba(255,255,255,.08);"> ${escapeHtml(item.name || "未识别姓名")} </div> `).join("") : `<div style="opacity:.7;">暂无</div>`; state.panel.innerHTML = ` <div style="padding:12px 14px; border-bottom:1px solid rgba(255,255,255,.08);"> <div style="font-size:16px; font-weight:700;">求简历助手</div> <div style="font-size:12px; opacity:.75;">支持暂停 / 继续 / 停止 / 导出Excel</div> </div> <div style="padding:12px 14px;"> <div><b>已请求 ${state.requestedCount} 次</b></div> <div>已处理会话 ${state.processedConversationCount} 个</div> <div>倒计时 ${state.countdown}</div> <div>当前阶段:${escapeHtml(state.phase)}</div> <div>当前状态:${escapeHtml(state.status)}</div> <div>当前姓名:${escapeHtml(state.currentName || "未识别")}</div> <div>当前倒计时参数:${CONFIG.countdownSeconds} 秒</div> <div>每 ${CONFIG.refreshEveryConversationCount} 个会话刷新一次新消息</div> <div style="margin-top:10px; display:flex; gap:8px; flex-wrap:wrap;"> <button>// 点击第一个“有未读数字”的会话 const target = [...document.querySelectorAll('.geek-item')].find(item => { const countText = item.querySelector('.badge-count span')?.textContent?.trim(); return Number(countText) > 0; }); if (target) { target.click(); }

2、找到可以发送收简历的窗口,收简历

3、循环读取最后一份简历,并且点击 求简历按钮

【说明】

这是点击未读消息后出现的我两种简历3种对话框以及对应的html,我想实现 当如果没有请求过简历点击求简历按钮,等待10秒钟自动切换写一个 求简历如此反复,并且在屏幕上显示已发送多少次请求,显示 已请求 8次 倒计时 10 已请求 8次 倒计时 9 已请求 8次 倒计时 8 。。。 直到切换下一页,还有倒计时时间作为参数放在顶部可以修改,并且能够暂停 停止当前操作,把已请求姓名都列出来一行一个,增加一个按钮把已请求简历的名单能够导出excel。

(() => { /****************************************************************** * 可配置参数 ******************************************************************/ const CONFIG = { // 每个会话处理完成后,倒计时多少秒再切换到下一条 countdownSeconds: 10, // 点击“求简历”后,等待确认弹层出现的时间 openConfirmDelayMs: 300, // 点击“确定”后,最多等待多久确认“简历请求已发送” requestResultTimeoutMs: 5000, // 切换到下一条会话后,等待页面渲染时间 switchConversationDelayMs: 1000, // 左侧列表找不到下一条时,向下滚动的距离 listScrollStep: 700, // 内部轮询间隔 pollIntervalMs: 200, // 名单中是否去重 // true 同一个名字只保留一条 // false 同一个名字请求几次就记几条 uniqueNames: false, // 面板中最多展示多少条已请求姓名 maxShowNames: 300 }; /****************************************************************** * 如果旧脚本存在,先停掉,防止重复运行 ******************************************************************/ if (window.__bossResumeBot && typeof window.__bossResumeBot.stop === "function") { try { window.__bossResumeBot.stop(); } catch (e) {} } /****************************************************************** * 全局状态 ******************************************************************/ const state = { running: true, paused: false, stopRequested: false, requestedCount: 0, requestedRecords: [], countdown: 0, status: "初始化中...", phase: "idle", currentName: "", panel: null }; /****************************************************************** * 自定义停止异常 ******************************************************************/ class StopError extends Error { constructor(message = "脚本已停止") { super(message); this.name = "StopError"; } } /****************************************************************** * 基础工具函数 ******************************************************************/ function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } function textOf(el) { return (el?.textContent || "").replace(/\s+/g, " ").trim(); } function qs(selector, root = document) { return root.querySelector(selector); } function qsa(selector, root = document) { return [...root.querySelectorAll(selector)]; } function visible(el) { if (!el) return false; const style = getComputedStyle(el); const rect = el.getBoundingClientRect(); return ( style.display !== "none" && style.visibility !== "hidden" && rect.width > 0 && rect.height > 0 ); } function click(el) { if (!el) return false; el.dispatchEvent( new MouseEvent("click", { bubbles: true, cancelable: true, view: window }) ); return true; } function escapeHtml(str) { return String(str ?? "") .replaceAll("&", "&amp;") .replaceAll("<", "&lt;") .replaceAll(">", "&gt;") .replaceAll('"', "&quot;") .replaceAll("'", "&#39;"); } function excelCell(str) { return escapeHtml(String(str ?? "")).replace(/\n/g, "<br>"); } function nowString() { const d = new Date(); const y = d.getFullYear(); const m = String(d.getMonth() + 1).padStart(2, "0"); const day = String(d.getDate()).padStart(2, "0"); const h = String(d.getHours()).padStart(2, "0"); const min = String(d.getMinutes()).padStart(2, "0"); const s = String(d.getSeconds()).padStart(2, "0"); return `${y}-${m}-${day} ${h}:${min}:${s}`; } function normalizeText(str) { return String(str ?? "").replace(/\s+/g, " ").trim(); } function pickFirst(arr = [], matcher) { return arr.find(item => matcher(item)) || ""; } /****************************************************************** * 运行控制 ******************************************************************/ function guardRunning() { if (!state.running || state.stopRequested) { throw new StopError(); } } async function interruptibleSleep(ms) { let elapsed = 0; while (elapsed < ms) { guardRunning(); while (state.paused) { state.phase = "paused"; renderPanel(); await sleep(CONFIG.pollIntervalMs); guardRunning(); } const step = Math.min(CONFIG.pollIntervalMs, ms - elapsed); await sleep(step); elapsed += step; } } function pauseRunner() { if (!state.running) return; state.paused = true; state.phase = "paused"; state.status = "已暂停"; renderPanel(); } function resumeRunner() { if (!state.running) return; state.paused = false; state.phase = "idle"; state.status = "继续运行中..."; renderPanel(); } function stopRunner() { state.stopRequested = true; state.running = false; state.paused = false; state.countdown = 0; state.phase = "stopped"; state.status = "已停止"; renderPanel(); } /****************************************************************** * 浮动面板 ******************************************************************/ function createPanel() { const old = document.getElementById("__boss_resume_panel"); if (old) old.remove(); const panel = document.createElement("div"); panel.id = "__boss_resume_panel"; panel.style.cssText = ` position: fixed; top: 16px; right: 16px; z-index: 999999; width: 380px; max-height: 82vh; overflow: hidden; background: rgba(15, 23, 42, 0.95); color: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.28); font: 14px/1.6 Arial, sans-serif; user-select: text; border: 1px solid rgba(255,255,255,0.1); `; panel.addEventListener("click", (e) => { const act = e.target?.dataset?.act; if (!act) return; if (act === "pause") pauseRunner(); if (act === "resume") resumeRunner(); if (act === "stop") stopRunner(); if (act === "export") exportRequestedToExcel(); }); document.body.appendChild(panel); return panel; } function renderPanel() { if (!state.panel) return; const list = state.requestedRecords.slice(0, CONFIG.maxShowNames); const listHtml = list.length ? list.map(item => ` <div style="padding:4px 0; border-bottom:1px dashed rgba(255,255,255,.08);"> ${escapeHtml(item.name || "未识别姓名")} </div> `).join("") : `<div style="opacity:.7;">暂无</div>`; state.panel.innerHTML = ` <div style="padding:12px 14px; border-bottom:1px solid rgba(255,255,255,.08);"> <div style="font-size:16px; font-weight:700;">求简历助手</div> <div style="font-size:12px; opacity:.75;">支持暂停 / 继续 / 停止 / 导出Excel</div> </div> <div style="padding:12px 14px;"> <div><b>已请求 ${state.requestedCount} 次</b></div> <div>倒计时 ${state.countdown}</div> <div>当前阶段:${escapeHtml(state.phase)}</div> <div>当前状态:${escapeHtml(state.status)}</div> <div>当前姓名:${escapeHtml(state.currentName || "未识别")}</div> <div>当前倒计时参数:${CONFIG.countdownSeconds} 秒</div> <div style="margin-top:10px; display:flex; gap:8px; flex-wrap:wrap;"> <button>document.querySelectorAll('.geek-item').forEach(item => { const countText = item.querySelector('.badge-count span')?.textContent?.trim(); if (Number(countText) > 0) { item.click(); } });
http://www.cnnetsun.cn/news/2056472.html

相关文章:

  • GLM-TTS实战案例:用AI语音为你的视频创作增添情感色彩
  • 【VSCode 2026金融安全配置白皮书】:零信任架构下47项关键加固项实测验证(含央行合规对标清单)
  • 别再只会按AutoSet了!手把手教你玩转泰克MSO2000B示波器的触发与采样设置
  • 吊顶里的那根龙骨,后来怎么样了
  • MySQL 同步到目标库后,怎么确认数据一致?NineData 的同步与比对方案
  • 从家庭用电到工业变频:一文搞懂AC-AC变换器的三种核心玩法(相控、斩控、调功)
  • 股市学习心得-股市的一天
  • 顶会论文模块复现与二次创新:顶会 AAAI 2026:Adaptive Frequency Filter(自适应频域滤波)模块在图像去噪中的应用
  • 从‘牛马’到‘老板’:智能体时代的效率革命
  • 基于YOLO26的Apex游戏人物目标检测系统设计与实现(项目源码+数据集+模型权重+UI界面+python+深度学习+远程环境部署)
  • 遇水易释氢燃爆,镁合金加工润滑痛点一次性讲透
  • Ubuntu 20.04下,用Anaconda虚拟环境搞定pycairo和PyGObject安装(附清华源加速)
  • 【2026内存安全编码白皮书】:C语言开发者必看的5大零成本迁移路径与3类高危误用规避指南
  • CST案例:利用电流钳(current probe)测试实现电源模块的CE仿真
  • entity dto vo
  • 告别双系统!Win11下用WSL2+Ubuntu 20.04打造无缝AI开发环境(附Anaconda/PyTorch配置)
  • Udio 音频生成 API 集成指南
  • 智慧教育中的个性化学习与教学评估
  • 混合块注意力机制(MoBA)原理与实现详解
  • 国产化即时通讯软件怎么选?BeeWorks 的“全栈信创”答卷
  • 美的智能家电云端依赖的终结:Home Assistant本地网络控制方案
  • 3步解锁音乐自由:qmc-decoder帮你将QQ音乐专有格式转换为MP3/FLAC
  • 【嵌入式C安全适配LMM终极指南】:20年老兵亲授3大不可绕过的内存隔离方案
  • Obsidian Excel插件:一站式表格处理解决方案提升笔记效率90%
  • 无法解析的外部符号
  • Swagger接口文档除了在线看,还能怎么用?我整理了3种本地化导出方案(含Word/Excel)
  • PyCharm配置PyQt5开发环境避坑指南:解决QtDesigner路径找不到、PyUic转换失败等常见问题
  • 轻松发打卡:接龙管家 AI 30 秒创建,自动汇总超省心
  • 百度Create大会双主论坛议程揭晓,多项重磅升级发布将集中亮相
  • iOS调试中debugserver常见问题详解:连接失败、权限错误与反调试应对