公告:欢迎使用易班自动发帖工具,自动发帖零风险100%安全。
点我使用评论脚本
加QQ群获取免费试用额度,群号:912033859 验证密码为:9412
// ==UserScript== // @name 易班自动发帖网薪经验值 // @namespace https://wechatid.github.io/2024/11/06/Yiban-JSmonkey/ // @version 2.0 // @description 易班自动发贴微社区的脚本,完全自动获取网薪经验值。自动检测内容是否重复,重复即重新输入新的内容内容,易班微社区完全自动发帖脚本,自动获取网薪和经验值 // @match https://s.yiban.cn/userPost/detail // @grant GM_addStyle // @grant GM_xmlhttpRequest // @grant GM_download // @license All rights reserved // ==/UserScript== (function () { "use strict"; let sever = 'http://47.112.3.177:8000'; let SIMINPUTFROM_CONNET_AUTOINCREM = 0; let submits_count = 0; const panel = document.createElement('div'); panel.id = 'floating-panel'; panel.innerHTML = `
公告:欢迎使用易班自动发帖工具,自动发帖零风险100%安全。
点我使用评论脚本
加QQ群获取免费试用额度,群号:912033859 验证密码为:9412
${info_text}
来自:${from}
作者:${author}
`; // 触发input事件 const event = new Event('input', { bubbles: true, cancelable: true }); event.eventType = "message"; [input_1, input_2, connet].forEach(el => el.dispatchEvent(event)); // 填充完成后提交 submitForm(submit_btn); } catch (e) { console.error("数据处理失败:", e); alert('文案接口异常,请切换字母数字组合使用'); } }, onerror: function(error) { console.error("请求失败:", error); alert('文案接口异常,请切换字母数字组合使用'); } }); } else if (msgtype == "string") { // 生成随机字符串 let s = ''; for (let i = 0; i < 26; i++) { s += 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'[Math.random() * 36 | 0]; } // 填充内容 input_1.value = s; input_2.value = s; connet.innerHTML = `${s}
`; // 触发input事件 const event = new Event('input', { bubbles: true, cancelable: true }); event.eventType = "message"; [input_1, input_2, connet].forEach(el => el.dispatchEvent(event)); // 填充完成后提交 submitForm(submit_btn); } }; // ========== 核心:轮询等待DOM元素加载 ========== const checkElementLoaded = () => { const { input_1, input_2, connet, submit_btn } = getCoreElements(); // 元素全部找到 → 执行逻辑 if (input_1 && input_2 && connet && submit_btn) { executeLogic(); } else { retryCount++; // 未找到且未超时 → 继续轮询(每300ms检查一次) if (retryCount < MAX_RETRY) { setTimeout(checkElementLoaded, 300); } else { // 超时 → 终止并提示 console.error(`轮询${MAX_RETRY}次后仍未找到核心元素`); alert("页面加载超时,请刷新页面后重试"); } } }; // 启动轮询 checkElementLoaded(); }; window.scan_succeed = function () { let d; let _t = setInterval(() => { if (!isRunning) { clearInterval(_t); return; } d = document.querySelector("body > div.container > section > div.mdc-alert.mdc-alert--success > div"); if (d != null) { submits_count++; if (submits_count >= 20) { document.querySelector("head > title").innerHTML = "已完成! "; clearInterval(_t); } else { wait_cd(); clearInterval(_t); } } }, 1000); }; window.wait_cd = function () { let t = 60; let _t = setInterval(() => { if (!isRunning) { clearInterval(_t); return; } document.querySelector("head > title").innerHTML = `🎉 ${String(submits_count)} / ${String(t)}`; document.getElementById('posted').value = submits_count; t = t - 1; if (t == 0) { wait_cd_after(); document.querySelector("head > title").innerHTML = "😴 等待验证口令..."; clearInterval(_t); } }, 1000); }; window.wait_cd_after = function () { if (!isRunning) { return; } let continueTo = document.querySelector( "body > div.container > section > div.mdc-alert.mdc-alert--success > div > p > a:nth-child(2) > div.mdc-button__ripple" ); continueTo.click(); setTimeout(() => { edit_text(); scan_succeed(); }, 1000); }; // 运行开关:默认不自动执行,必须点击「开始运行」按钮才会启动脚本逻辑 let isRunning = false; function stopRunLogic() { // 停止所有可能的定时器与后续链路 if (interval) { clearInterval(interval); interval = null; } try { document.querySelector("head > title").innerHTML = "已停止"; } catch (e) { /* 忽略 */ } } const runToggleBtn = document.getElementById('run-toggle-btn'); const runToggleText = runToggleBtn.querySelector('.run-toggle-text'); const runToggleIcon = runToggleBtn.querySelector('.run-toggle-icon'); function updateRunButtonUI() { runToggleBtn.classList.toggle('run-start', !isRunning); runToggleBtn.classList.toggle('run-stop', isRunning); runToggleText.textContent = isRunning ? '停止' : '开始运行'; runToggleIcon.innerHTML = isRunning ? '■' : '▶'; } runToggleBtn.addEventListener('click', function () { if (!isRunning) { if (!savedKey) { alert('请先输入并保存卡密,再点击开始运行'); return; } isRunning = true; updateRunButtonUI(); edit_text(); scan_succeed(); } else { isRunning = false; updateRunButtonUI(); stopRunLogic(); } }); function w1t67rL1() { let pW7x = 5; let vB8j = 10; return pW7x + vB8j; } function z3lT9r0A(a, b) { let Y0i9p = a * b; let qN2u9s = Y0i9p / 2; return Y0i9p - qN2u9s; } function dB3J2wK() { let H7f = [1, 2, 3, 4, 5]; H7f.push(6); H7f.pop(); return H7f.length; } function tR8c2N(value) { let k0j = { a: 1, b: 2, c: 3 }; let f6d = k0j[value]; return f6d; } function qT5w3X() { let M9b = "hello"; let F7g = "world"; return M9b + F7g; } function nW8r1Z() { let o8Q = 100; for (let z3p = 0; z3p < o8Q; z3p++) { Math.random(); } return null; } function s1M9l3P(str) { let vQ9a = ''; for (let i = 0; i < str.length; i++) { vQ9a += str.charAt(i); } let reversed = vQ9a.split('').reverse().join(''); return reversed === vQ9a ? true : false; } // ====================================================================== // 【本次新增功能】发帖范围 / 版块 的选择与自动应用 // ---------------------------------------------------------------------- // 说明(纯新增,不改动上方任何原有变量、函数与流程): // 1. 数据来源与 Python 端保持一致(易班官方接口): // GET https://s.yiban.cn/api/org/getMyOrgs -> 发布范围 // GET https://s.yiban.cn/api/board/list?orgId=xxx -> 版块 // Cookie 由 GM_xmlhttpRequest 自动携带(当前浏览器登录态)。 // 2. 选择结果保存在 localStorage: // yiban_post_org { id, name } // yiban_post_board { id, name } // yiban_post_auto_select "1" / "0" // 3. 页面发帖表单里存在原生下拉框(label「发布范围:」「选择版块:」 // + select.custom-select),本功能只负责把保存的值写进去。 // ====================================================================== (function initPostSelectFeature() { "use strict"; const ORG_LIST_API = "https://s.yiban.cn/api/org/getMyOrgs"; const BOARD_LIST_API = "https://s.yiban.cn/api/board/list"; const STORE_ORG = "yiban_post_org"; const STORE_BOARD = "yiban_post_board"; const STORE_AUTO = "yiban_post_auto_select"; // ---------- 1. 新增样式(独立调用,不影响原有 GM_addStyle) ---------- GM_addStyle(` #floating-panel .yiban-opt-box { margin-top: 8px; margin-bottom: 0; } #floating-panel .yiban-opt-box label { display: block; font-size: 12px; margin-bottom: 4px; color: #333; } #floating-panel .yiban-opt-select { width: 100%; padding: 4px; font-size: 12px; background: white; border: 2px solid #ff9900; border-radius: 5px; margin-bottom: 6px; } #floating-panel .yiban-opt-select:disabled { opacity: 0.6; } #floating-panel .yiban-opt-row { display: flex; gap: 6px; } #floating-panel .yiban-opt-btn { flex: 1; padding: 6px 0; font-size: 12px; border: 1px solid #007bff; border-radius: 5px; background: #fff; color: #007bff; cursor: pointer; } #floating-panel .yiban-opt-btn:hover { background: #eaf3ff; } #floating-panel .yiban-opt-auto { display: flex; align-items: center; font-size: 12px; margin-top: 6px; } #floating-panel .yiban-opt-auto input { width: auto; margin: 0; } #floating-panel .yiban-opt-auto label { display: inline; margin: 0 0 0 5px; } #floating-panel .yiban-opt-tip { font-size: 11px; color: #888; margin-top: 4px; min-height: 14px; word-break: break-all; } `); const panelContentEl = document.querySelector("#floating-panel .content"); if (!panelContentEl) { return; } // ---------- 2. localStorage 读写 ---------- const readSaved = function (key) { try { const raw = localStorage.getItem(key); return raw ? JSON.parse(raw) : null; } catch (e) { return null; } }; const writeSaved = function (key, value) { try { localStorage.setItem(key, JSON.stringify(value)); } catch (e) { /* 忽略存储异常 */ } }; // ---------- 3. 动态插入新增 UI(原有 innerHTML 不做任何改动) ---------- const box = document.createElement("div"); box.className = "yiban-opt-box"; box.innerHTML = `