返回资讯中心
外部精选
软件工程
#开发者实时流

AI 回复被屏蔽事件页面代码节选

来源标题:Blocked for AI Reply

该页面通过 JavaScript 按“AI 回复优先”排序账号,并提供按屏蔽时间倒序查看的选项。代码还包含主题切换逻辑,默认跟随系统主题,并记住用户手动选择。

Hacker News 最新nreece2026/11/23 · 今天11 分钟阅读

以下正文由 AI 翻译自 Hacker News 最新(原文版权归原站所有),可能存在偏差,重要内容请以原文为准。

const xUrl = x => x.h ? https://x.com/${encodeURIComponent(x.h)} : https://x.com/i/user/${x.i}; /* 主题切换:默认跟随系统,手动选择会被记住 */ const themeKey = 'bfar-theme'; function getTheme(){ try { return localStorage.getItem(themeKey); } catch(e){ return null; } } function applyTheme(t){ if (t) document.documentElement.setAttribute('data-theme', t); else document.documentElement.removeAttribute('data-theme'); } function isDark(){ const t = document.documentElement.getAttribute('data-theme'); return t ? t === 'dark' : matchMedia('(prefers-color-scheme: dark)').matches; } applyTheme(getTheme()); function toggleTheme(){ const t = isDark() ? 'light' : 'dark'; applyTheme(t); try { localStorage.setItem(themeKey, t); } catch(e){} render(); } const sun = ''; const moon = ''; const themeBtn = () => ${isDark()?sun:moon}; function list(){ return TABS[state.tab][1]; } const SORTS = { // 默认:已记录 AI 回复的账号排在前面,其余保持原顺序(排序是稳定的) default: ['AI回复优先显示', (a, b) => hasQuote(b) - hasQuote(a)], blocked: ['最新拉黑优先', (a, b) => (b.b || '').localeCompare(a.b || '') || idDesc(a, b)], blockedOld: ['最早拉黑优先', (a, b) => (!a.b - !b.b) || (a.b || '').localeCompare(b.b || '') || idDesc(a, b)], newest: ['最新账号优先', (a, b) => idDesc(a, b)], oldest: ['最早账号优先', (a, b) => idDesc(b, a)] }; function hasQuote(x){ return (x.e || []).some(e => e.r && e.r.s === 'ok' && e.r.text) ? 1 : 0; } function idDesc(a, b){ return a.i.length !== b.i.length ? b.i.length - a.i.length : (a.i b.i ? -1 : 0); } function filtered(){ const q = state.q.trim().toLowerCase().replace(/^@/, ''); const base = !q ? list() : list().filter(x => (x.h && x.h.toLowerCase().includes(q)) || x.i.includes(q) || x.e.some(e => e.text.toLowerCase().includes(q) || (e.r && e.r.text && e.r.text.toLowerCase().includes(q)))); const cmp = SORTS[state.sort][1]; return cmp ? base.slice().sort(cmp) : base; function metaLine(x){ const parts = []; if (x.L === 'A') parts.push(因${x.S ? '群发垃圾信息' : 'AI回复'}于 ${day(x.b)} 被拉黑); if (x.sus || x.gone) parts.push('已封禁或已删除'); if (x.R) parts.push(抽样 ${fmt(x.R.a)} 条 AI 回复,来自 ${fmt(x.R.s)}${x.R.p != null ? · 峰值 ${x.R.p}% : ''}); if (x.D) parts.push("通过 @dillon_mulroy 的名单拉黑"); if ((x.L === 'B' || x.L === 'C') && !x.R) parts.push('被拉黑但无回复记录'); parts.push(创建于 ${month(x.c)}); return parts.join(' · '); function sources(x){ const s = []; if (x.D && x.L !== 'A') s.push('通过 @dillon_mulroy 的名单拉黑'); if (x.R) s.push('由 @ryanvogel 标记'); return s.join(''); function quote(x){ // 导致其被拉黑的那条 AI 回复,前提是我们还保留着它的文本 const e = (x.e || []).find(e => e.r && e.r.s === 'ok' && e.r.text); return e ? “${esc(e.r.text)}” : ''; function row(x){ const ini = esc((x.h || '?')[0].toUpperCase()); const img = x.h && !x.gone ? `` : ''; return ${ini}${img}${esc(name(x))}${vchk(x)}${dbadge(x)}${esc(metaLine(x))}${quote(x)} ; // 无限滚动:当底部距离屏幕 800px 以内时,追加下一批 PER 行 let moreItems = []; function loadMore(){ const ul = app.querySelector('.accounts'), more = document.getElementById('more'), count = document.getElementById('count'); if (!ul || !more || !count) return; let shown = ul.querySelectorAll('li:not(.empty)').length; while (shown = total ? 已显示全部 ${fmt(total)} 个账号 : 已显示 ${fmt(shown)} / ${fmt(total)} 个账号…; function renderList(){ const items = filtered(); const pages = Math.max(1, Math.ceil(items.length / PER)); if (state.page > pages) state.page = pages; const slice = items.slice(0, state.page * PER); const tab = (key, label, n) => ${label} ${fmt(n)}; app.innerHTML = 因 AI 回复被拉黑 ${fmt(DATA.length)} 个 𝕏 账号持续刷自动化 AI 回复,人为刷互动量,破坏 𝕏 的社交网络${DEAD ? - 其中 ${fmt(DEAD)} 个已被 𝕏 封禁: ''} - 持续更新 ${themeBtn()}全部拉黑 AI 回复机器人举报 AI 回复机器人 导出 →复制提示词全部账号JSON API全部用户名已移除 搜索账号 ${fmt(items.length)} 个${items.length === 1 ? '账号' : '账号'}排序${Object.entries(SORTS).map(([k,[l]]) =>${l}).join('')} ${slice.length ? slice.map(row).join('') : 没有匹配 "${esc(state.q)}" 的账号。 `} ${countText(slice.length, items.length)}

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →