{"record":{"id":"6f7ad8521bd2d4ae","repo":"jackwener/OpenCLI","slug":"linkedin-com","errorCode":null,"errorMessage":"linkedin.com","messagePattern":"linkedin\\.com","errorType":"exception","errorClass":"AuthRequiredError","httpStatus":null,"severity":"error","filePath":"clis/linkedin/timeline.js","lineNumber":495,"sourceCode":"    columns: ['rank', 'author', 'author_url', 'headline', 'text', 'posted_at', 'reactions', 'comments', 'url'],\n    func: async (page, kwargs) => {\n        const limit = Math.max(1, Math.min(kwargs.limit ?? 20, 100));\n        await page.goto('https://www.linkedin.com/feed/');\n        await page.wait(4);\n        let posts = [];\n        let sawLoginWall = false;\n        for (let i = 0; i < 6 && posts.length < limit; i++) {\n            const batch = await extractVisiblePosts(page);\n            if (batch?.loginRequired)\n                sawLoginWall = true;\n            posts = mergeTimelinePosts(posts, Array.isArray(batch?.posts) ? batch.posts : []);\n            if (posts.length >= limit)\n                break;\n            await page.autoScroll({ times: 1, delayMs: 1200 });\n            await page.wait(1);\n        }\n        if (sawLoginWall && posts.length === 0) {\n            throw new AuthRequiredError('linkedin.com', 'LinkedIn timeline requires an active signed-in browser session');\n        }\n        if (posts.length === 0) {\n            throw new EmptyResultError('linkedin timeline', 'Make sure your LinkedIn home feed is visible in the browser.');\n        }\n        return posts.slice(0, limit).map((post, index) => ({\n            rank: index + 1,\n            ...post,\n        }));\n    },\n});\nexport const __test__ = {\n    parseMetric,\n    buildPostId,\n    mergeTimelinePosts,\n    normalizeTimestamp,\n};\n","sourceCodeStart":477,"sourceCodeEnd":512,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/linkedin/timeline.js#L477-L512","documentation":"The linkedin timeline command scrolls the home feed collecting posts; if a login wall was detected (sawLoginWall) and zero posts were collected, it throws AuthRequiredError with domain 'linkedin.com', indicating the browser is not signed in so the feed cannot be read.","triggerScenarios":"Fetching the LinkedIn timeline while the browser session is logged out or the login wall appeared before any posts rendered, with posts.length === 0.","commonSituations":"Expired LinkedIn session in the automation browser; first run without completing the site login flow; LinkedIn showing an interstitial login page on a fresh profile; region or network triggering a forced login wall.","solutions":["Run the LinkedIn auth/login flow in the browser and confirm the home feed shows posts when opened manually","Re-run the timeline command after sign-in","Use a persistent browser profile so the session cookie survives restarts","Avoid IP ranges/proxies that trigger LinkedIn's forced login wall"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const cookies = await page.getCookies({ url: 'https://www.linkedin.com' });\nif (!cookies.some(c => c.name === 'li_at' && c.value)) throw new Error('Not signed in to LinkedIn');","typeGuard":"const isAuthRequired = (e) => e instanceof Error && /AuthRequired|signed-in browser session/.test(e.message);","tryCatchPattern":"try {\n  const posts = await linkedinTimeline({ limit });\n} catch (e) {\n  if (isAuthRequired(e)) { await linkedinLogin(); return linkedinTimeline({ limit }); }\n  throw e;\n}","preventionTips":["Complete the login flow once per browser profile and reuse the profile","Check the home feed renders signed-in before running timeline fetches","Use stable residential IPs; avoid datacenter proxies that trigger login walls","Refresh the session periodically on long-running profiles"],"tags":["linkedin","authentication","login-wall","browser-automation"],"backgroundTag":"auth-required-login-wall","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}