{"record":{"id":"cf423b90ad4b3ef9","repo":"jackwener/OpenCLI","slug":"1point3acres-user","errorCode":null,"errorMessage":"1point3acres user","messagePattern":"1point3acres user","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"info","filePath":"clis/1point3acres/user.js","lineNumber":36,"sourceCode":"    strategy: Strategy.PUBLIC,\n    browser: false,\n    args: [\n        { name: 'who', required: true, positional: true, help: '用户名或 uid（纯数字按 uid 查，否则按用户名）' },\n    ],\n    columns: [\n        'uid', 'username', 'group', 'credits', 'rice',\n        'posts', 'threads', 'digests', 'registerTime', 'lastAccess', 'profileUrl',\n    ],\n    func: async (args) => {\n        const who = String(args.who || '').trim();\n        if (!who) throw new ArgumentError('who 不能为空', '传用户名或数字 uid');\n        const url = /^\\d+$/.test(who)\n            ? `${BASE}/space-uid-${who}.html`\n            : `${BASE}/space-username-${encodeURIComponent(who)}.html`;\n\n        const html = await fetchHtml(url);\n        if (/<title>提示信息/.test(html) && /(没有找到|不存在)/.test(html)) {\n            throw new EmptyResultError('1point3acres user', `用户 \"${who}\" 不存在`);\n        }\n\n        const pick = (re) => {\n            const m = html.match(re);\n            return m ? decodeEntities(m[1].trim()) : '';\n        };\n        // <li>KEY: VAL</li>   — tolerant of optional <span>, colons fullwidth/半角, 颗/根/粒 suffixes.\n        const pickLi = (label) => {\n            const re = new RegExp(`<li>\\\\s*${label}[：:\\\\s]*(?:<[^>]+>)?\\\\s*([^<]+?)\\\\s*(?:<|$)`);\n            const m = html.match(re);\n            return m ? decodeEntities(m[1].trim()) : '';\n        };\n\n        const username =\n            pick(/<p class=\"mtm[^\"]*\"[^>]*>\\s*<a [^>]*>([^<]+?)<\\/a>/) ||\n            pick(/<title>([^<]+?)的个人资料/);\n        const uid = pick(/uid=(\\d+)/) || pick(/space-uid-(\\d+)\\.html/);\n        const group = pickLi('用户组');","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/1point3acres/user.js#L18-L54","documentation":"EmptyResultError thrown when the fetched user profile (space-uid-*.html / space-username-*.html) is a Discuz '提示信息' notice page containing 没有找到/不存在 — meaning the user does not exist or the profile is inaccessible as a guest. The requested `who` value is echoed in the detail.","triggerScenarios":"Querying a uid that was never registered or was purged; a username with different Unicode normalization/whitespace than the account; querying a suspended/banned member whose space page is a notice; wrong URL-encoding of special characters in the username.","commonSituations":"User renamed their account; searching a nickname/display name instead of the actual login username; copied username containing invisible characters or full-width spaces; old uids recycled/removed on the forum.","solutions":["Verify the username/uid exists by visiting the space URL in a browser","Try the numeric uid instead of the username (avoids encoding/normalization issues)","Trim and normalize the username (NFC) and retry — watch for invisible characters from copy-paste","If the profile is visible in a browser but not via the CLI, the account likely requires login — the guest fetch cannot see it"],"exampleFix":"// before\nuser({ who: 'ｄａｖｉｄ' })  // full-width chars → user not found\n// after\nuser({ who: 'david'.normalize('NFKC') })","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"try {\n  const profile = await user({ who });\n} catch (e) {\n  if (e instanceof EmptyResultError) {\n    console.warn(`User \"${who}\" does not exist or is not visible as a guest`);\n  } else throw e;\n}","preventionTips":["Prefer uid lookups to avoid username encoding/normalization issues","Normalize copied usernames (trim, NFKC) to remove invisible/full-width characters","Verify the account exists in a browser for critical flows"],"tags":["user-not-found","empty-result","scraping"],"backgroundTag":"resource-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}