油猴脚本 - 烧饼论坛自动签到
9310
- 复制下面代码
- 浏览器拓展程序 - 篡改猴 - 添加新脚本
- Ctrl + A
- Ctrl + V
- Ctrl + S
- 刷新网页
// ==UserScript== // @name sb.sb 自动签到 // @namespace https://sb.sb/ // @version 1.0 // @description sb.sb 自动签到 // @match https://sb.sb/* // @run-at document-idle // ==/UserScript== (async () => { 'use strict'; const URL = '/signin/'; const KEY = 'sb_signin_date'; // UTC 日期 const today = new Date().toISOString().slice(0, 10); // 今天已经成功签到过 if (localStorage.getItem(KEY) === today) return; // 网页弹窗 function popup(text, color = '#16a34a') { const old = document.querySelector('#sb-popup'); if (old) old.remove(); const div = document.createElement('div'); div.id = 'sb-popup'; div.textContent = text; Object.assign(div.style, { position: 'fixed', right: '20px', bottom: '20px', zIndex: '999999', padding: '12px 18px', borderRadius: '8px', color: '#fff', background: color, font: '14px sans-serif', boxShadow: '0 4px 15px #0004' }); document.body.appendChild(div); setTimeout(() => div.remove(), 4000); } try { // 获取签到页面 let res = await fetch(URL, { credentials: 'same-origin', cache: 'no-store' }); let html = await res.text(); // 已经签到 if (/今日已签到|今天已签到|已经签到/.test(html)) { localStorage.setItem(KEY, today); popup('今天已经签到 ✓'); return; } // 获取 CSRF const doc = new DOMParser().parseFromString(html, 'text/html'); const token = doc.querySelector('meta[name="csrf-token"]')?.content || doc.querySelector('input[name="csrf_token"]')?.value; if (!token) throw new Error('找不到 CSRF Token'); // 提交签到 const data = new FormData(); data.append('csrf_token', token); res = await fetch(URL, { method: 'POST', credentials: 'same-origin', headers: { 'X-CSRF-Token': token, 'X-Requested-With': 'XMLHttpRequest' }, body: data }); html = await res.text(); // 验证结果 if (!/今日已签到|今天已签到|已经签到/.test(html)) { res = await fetch(URL, { credentials: 'same-origin', cache: 'no-store' }); html = await res.text(); } if (/今日已签到|今天已签到|已经签到/.test(html)) { localStorage.setItem(KEY, today); popup('签到成功 🎉'); } else { throw new Error('无法确认签到结果'); } } catch (e) { console.error('[sb.sb 自动签到]', e); popup('签到失败:' + e.message, '#dc2626'); } })();- 收藏支持反对打赏 1

感谢
bd
bd

签到留言触发暴击的几率会更大哦
@Showfom #4 竟然还有这个设定,那我每日 1 饼的日子算什么😭
@xiaoshuai #5 算你老实?

@xiaoshuai #5 那现在知道了吧?
@NBA #7 知道了 但是我是非酋 不信暴击的概率会发生在我身上🆘

bd

@Showfom #4 你现在才说?我前面的每日 1 饼。