360 Secure SkillHub
360 安全技能中心

SocialKit LinkedIn Post

调用 LinkedIn 官方 Posts API,在用户批准后将文本、链接、图片或视频帖子发布到个人 LinkedIn 主页;包含 OAuth 登录、发布前校验和结果报告,公司主页发布需单独获批的 API 应用。

分类:营销
ahmadhussain0335
ahmadhussain0335
热度 36.94
最近更新 2026-11-06 14:57:14

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add ahmadhussain0335/socialkit-linkedin-post
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
name
socialkit-linkedin-post
description
Publishes a text, link, image or video post to the user's personal LinkedIn profile through the official Posts API after the user approves it. Use when the user wants to post on LinkedIn. Company page posting needs a separately approved Community Management API app.
license
MIT
metadata
{"author":"Ahmad Hussain","platform":"linkedin","requires":"socialkit-social-core"}

LinkedIn post

Apply socialkit-social-core. Official API only. Setup: setup.

Rules

  • Posts go to the personal profile; company pages need the Community Management API and options.organizationUrn.
  • Link previews are not fetched: set options.title (and options.description) for link posts.
  • The sign-in lasts 60 days and cannot be refreshed; sign in again when it expires.

Steps

  1. Sign in once: node scripts/auth.mjs --platform linkedin --start, give the user the signInUrl, then node scripts/auth.mjs --platform linkedin --finish --url "<URL they landed on>".
  2. Create the post folder with the socialkit-social-core post script: node <socialkit-social-core>/scripts/post.mjs --init --dir li-<slug> --platform linkedin --kind <text|link|image|video>
  3. Write post.json (text, media with alt text, options). See node scripts/publish.mjs --help.
  4. Validate: node scripts/publish.mjs --check --dir li-<slug>
  5. Stop. Show the post. Ask the user to approve in their own terminal: node <socialkit-social-core>/scripts/post.mjs --approve --dir li-<slug>
  6. Publish: node scripts/publish.mjs --publish --dir li-<slug> and report the result.

Failure handling

  • LINKEDIN_401: sign in again.
  • Version errors: set LINKEDIN_VERSION to a current YYYYMM version.
  • APPROVAL_REQUIRED: the post changed after approval; ask again.
  • ALREADY_PUBLISHED: this folder was posted; use --allow-repost only if the user asks.