← 返回
数据分析 中文

Linkedin - automation

LinkedIn automation — post (with image upload), comment (with @mentions), edit/delete comments, repost, read feed, analytics, like monitoring, engagement tracking, and content calendar with approval workflow. Uses Playwright with persistent browser profile. Use for any LinkedIn task including content strategy, scheduled publishing, engagement analysis, and audience growth.
领英自动化工具——支持发帖(含图片上传)、评论(含@提及)、评论编辑/删除、转发、动态读取、分析、点赞监控、互动追踪及含审批流程的内容日历。基于Playwright持久浏览器配置文件运行。适用于内容策略、定时发布、互动分析及受众增长等各类领英任务。
red777777
数据分析 clawhub v1.0.1 1 版本 99881.2 Key: 无需
★ 5
Stars
📥 3,263
下载
💾 1
安装
1
版本
#latest

概述

LinkedIn Automation

> Author: Community Contributors

>

> ⚠️ DISCLAIMER — PERSONAL USE ONLY

> This skill is provided for personal, non-commercial use only. It automates your own LinkedIn account for personal productivity and engagement. Do NOT use this skill for spam, mass outreach, scraping other users' data, or any commercial automation service. Use responsibly and in accordance with LinkedIn's User Agreement. The author assumes no liability for misuse or account restrictions.

Automate LinkedIn interactions via headless Playwright browser with a persistent session.

Prerequisites

  • Python 3.10+ with Playwright installed (pip install playwright && playwright install chromium)
  • A logged-in LinkedIn browser session (persistent Chromium profile)
  • Adjust paths in scripts/lib/browser.py to match your setup

Commands

CLI={baseDir}/scripts/linkedin.py

# Check if session is valid
python3 $CLI check-session

# Read feed
python3 $CLI feed --count 5

# Create a post (text only)
python3 $CLI post --text "Hello world"

# Create a post with image (handles LinkedIn's image editor modal automatically)
python3 $CLI post --text "Hello world" --image /path/to/image.png

# Comment on a post (supports @Mentions — see below)
python3 $CLI comment --url "https://linkedin.com/feed/update/..." --text "Great insight @Betina Weiler!"

# Edit a comment (match by text fragment)
python3 $CLI edit-comment --url "https://..." --match "old text" --text "new text"

# Delete a comment
python3 $CLI delete-comment --url "https://..." --match "text to identify"

# Repost with thoughts
python3 $CLI repost --url "https://..." --thoughts "My take..."

# Engagement analytics for recent posts
python3 $CLI analytics --count 10

# Profile-level stats (followers, views)
python3 $CLI profile-stats

# Monitor your likes for new ones (for comment suggestions)
python3 $CLI scan-likes --count 15

# Scrape someone's activity
python3 $CLI activity --profile-url "https://linkedin.com/in/someone/" --count 5

All commands output JSON. Enable debug logging: LINKEDIN_DEBUG=1.

@Mentions

Comments support @FirstName LastName syntax. The skill:

  1. Types @FirstName → waits for typeahead dropdown
  2. Progressively types last name letter by letter if needed
  3. Clicks the match only if first+last name both match
  4. Falls back to plain text if person not found (returns mention_failed warning)

Check mentions in the JSON result to see if mentions succeeded.

Like Monitor

The scan-likes command checks your recent likes/reactions activity and returns any new likes since the last check. State is persisted to avoid duplicate alerts. Ideal for cron/heartbeat integration:

# In HEARTBEAT.md or cron job:
python3 $CLI scan-likes → if new likes found → suggest comment for each

⚠️ Golden Rule

NEVER post, comment, repost, edit, or delete anything without EXPLICIT user approval.

Always show the user exactly what will be posted and get a clear "yes" before executing. Read-only actions (feed, analytics, check-session, scan-likes) are safe to run freely.

Content Calendar (Scheduled Publishing)

Full approval-based publishing workflow with auto-posting. See references/content-calendar.md for setup.

  • Webhook (scripts/cc-webhook.py): Receives approve/edit/skip from a frontend UI
  • Auto-apply: Simple edits ("old text -> new text") applied instantly by webhook
  • Agent processing: Complex edits flagged for AI-powered text rewriting
  • Auto-post: Approved posts past their scheduled time are posted automatically via cron
  • Image strategy: Real photos + AI-generated story overlays (not stock photos)
# Start the webhook (or install as systemd service)
python3 scripts/cc-webhook.py

# Env vars for config:
# CC_DATA_FILE=/path/to/cc-data.json
# CC_ACTIONS_FILE=/path/to/actions.json
# CC_WEBHOOK_PORT=8401

Content Strategy & Engagement

Rate Limits

ActionDaily MaxWeekly Max
-----------------------------
Posts2–310–15
Comments20–30
Likes100
Connection requests30100

Setup

  1. Install dependencies: pip install playwright && playwright install chromium
  2. Configure browser profile path in scripts/lib/browser.py (or set LINKEDIN_BROWSER_PROFILE env var)
  3. Log in to LinkedIn manually once (the session persists)
  4. Run python3 scripts/linkedin.py check-session to verify
  5. Learn your voice: Run python3 scripts/linkedin.py learn-profile — this scans your recent posts and comments to learn your tone, topics, language, and style. The agent uses this profile when suggesting comments/posts so they sound like you, not like a generic bot.

Voice & Style

On first setup, learn-profile analyzes your content and saves a style profile (~/.linkedin-style.json) containing:

  • Language (de/en/mixed)
  • Tone (casual / professional / professional-friendly)
  • Emoji usage (heavy / moderate / minimal)
  • Top hashtags you use
  • Sample posts and comments for voice reference

The agent should ALWAYS read this profile (get-style) before drafting any comment or post suggestion. Never impose a foreign voice — match the user's natural style.

Post Age Warning

CRITICAL: Before suggesting a comment on any post, check how old the post is:

  • < 2 weeks: Safe to comment
  • > 2 weeks: Warn the user explicitly ("⚠️ This post is X weeks old — commenting on old posts can look like bot behavior. Still want to?")
  • > 1 month: Strongly discourage unless there's a specific reason

Commenting on old posts makes it look like you're mining someone's history with a bot. Always flag post age.

Troubleshooting

  • Session expired: Log in again via browser profile
  • Selectors broken: LinkedIn updates UI frequently — check references/dom-patterns.md and update scripts/lib/selectors.py
  • Debug screenshots: Saved to /tmp/linkedin_debug_*.png on failure

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-28 11:33 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

A股量化 AkShare

mbpz
A股量化数据分析工具,基于AkShare库获取A股行情、财务数据、板块信息等。用于回答关于A股股票查询、行情数据、财务分析、选股等问题。
★ 166 📥 60,196
data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 199 📥 65,231
data-analysis

Stock Analysis

udiedrichsen
{"answer":"基于雅虎财经数据,分析股票与加密货币。支持投资组合管理、自选股预警、股息分析、8维评分、热门趋势扫描及传闻/早期信号探测。适用于股票分析、持仓追踪、财报异动、加密监控、热门股追踪或提前发掘非主流传闻。"}
★ 270 📥 57,019