魔改了个论坛脚本,能看 TL(TrustLevel) 升级进度 !!仅供参考 实际还有一些暗坑 详见描述!!

TL3 升级靠 @Troogle@davidlee 在主楼引用里已经扒清楚的那几条隐藏规则,但 widget 还是全绿人没升挺常见的。我自己就是典型: 25 / 20 likes received 绿的刺眼,结果一直卡在 TL2 好几天。

后来发现这 25 个赞是全都挤在 4 天内。用 discourse 的 user_actions.json 查了一下自己的 like days 才 4 / 7,差 3 天。

所以把主楼提到的三条隐藏规则写成了个 console 小脚本,粘到 console 回车就能看具体差在哪。第四条 “days_visited 要当天 posts_read > 0” 那条因为 user_visits 表不对外所以查不了,没办法(不过应该很少有人会卡在这一条吧)

点击展开脚本 (粘到浏览器 console 回车, 右上角会出诊断浮窗)
(async () => {
  const D = 100, P = 30, MAX = 60;
  const BASE = location.origin;
  const since = Date.now() - D * 86400000;
  const T = { users: 5, days: 7, topics: 10 };

  const me = document.querySelector('meta[name="current-user-username"]')?.content
         || (await (await fetch(BASE + '/session/current.json', {credentials:'same-origin'})).json())?.current_user?.username;
  if (!me) { console.error('not logged in'); return; }

  async function fetchAll(filter) {
    const out = [];
    for (let p = 0; p < MAX; p++) {
      const r = await fetch(`${BASE}/user_actions.json?username=${me}&filter=${filter}&offset=${p*P}&limit=${P}`,
        { credentials: 'same-origin', headers: { Accept: 'application/json' } });
      if (!r.ok) break;
      const items = (await r.json()).user_actions || [];
      if (!items.length) break;
      let cut = false;
      for (const a of items) {
        if (Date.parse(a.created_at) < since) { cut = true; break; }
        out.push(a);
      }
      if (cut || items.length < P) break;
    }
    return out;
  }

  const [L, R] = await Promise.all([fetchAll(2), fetchAll(5)]);
  const users  = new Set(L.map(a => a.acting_username)).size;
  const days   = new Set(L.map(a => a.created_at.slice(0, 10))).size;
  const topics = new Set(R.map(a => a.topic_id)).size;

  const fmt = (cur, need, label) =>
    `  ${cur >= need ? '✅' : '❌'}  ${String(cur).padStart(3)} / ${need}   ${label}`;
  const msg = [
    `=== TL3 Hidden Checks (past ${D} days) @${me} ===`,
    fmt(users,  T.users,  'Unique likers'),
    fmt(days,   T.days,   'Distinct like-days'),
    fmt(topics, T.topics, 'Distinct topics replied'),
  ].join('\n');

  console.warn(msg);

  document.getElementById('tl3-hidden-overlay')?.remove();
  const o = Object.assign(document.createElement('pre'), {
    id: 'tl3-hidden-overlay', textContent: msg,
    title: 'click to close',
  });
  Object.assign(o.style, {
    position:'fixed', top:'20px', right:'20px', zIndex:'99999',
    background:'#1f2937', color:'#e5e7eb', padding:'12px 16px',
    borderRadius:'8px', font:'13px ui-monospace,menlo,monospace',
    whiteSpace:'pre', boxShadow:'0 10px 30px rgba(0,0,0,.4)', cursor:'pointer',
  });
  o.onclick = () => o.remove();
  document.body.appendChild(o);
})();

跑出来长这样:

=== TL3 Hidden Checks (past 100 days) @Luxisme ===
  ✅   25 / 5     Unique likers
  ❌    4 / 7     Distinct like-days
  ✅   30 / 10    Distinct topics replied
5 个赞