Facebook Humanistic Profile Control
/install fb-profile-control
FB Group Scanner Skill
Scan Facebook groups for targeted posts and auto-comment using undetected browser automation.
⚠️ Before You Start
- Cookies = credentials.
FB_COOKIE_FILEgrants full Facebook account access. Store withchmod 600, never commit to git. - Use a dedicated/throwaway FB account — never your personal account.
- Dry-run is ON by default (
FB_DRY_RUN=true). The skill will scan and log matches but post zero comments until you explicitly setFB_DRY_RUN=false. - Run in a container or VM — not directly on your host machine.
- May violate Facebook TOS. You are responsible for compliance.
Environment Variables
| Variable | Required | Secret | Description |
|---|---|---|---|
FB_COOKIE_FILE |
✅ | ✅ | Path to Facebook cookies JSON (Selenium format). Full account access — treat as password. |
FB_STATE_FILE |
✅ | — | Writable path for Playwright storage state (default: /tmp/fb_state.json) |
FB_DRY_RUN |
— | — | true (default) = scan only. false = live commenting. |
FB_USER_AGENT |
— | — | Override browser user agent |
NOTIFY_WEBHOOK |
— | ✅ | Webhook URL for match alerts. Skipped if unset. |
Install
pip install -r scripts/requirements.txt # patchright from PyPI
python -m patchright install chromium # Chromium from Playwright distribution
How to Get Cookies
- Log in to Facebook in real Chrome (manually, once, dedicated account)
- Export all
facebook.comcookies as JSON via EditThisCookie or DevTools - Save to the path in
FB_COOKIE_FILEwithchmod 600
Cookies last ~30–90 days. Re-export manually when expired — no automated re-login included.
Architecture
Patchright browser (stealth Chromium — patches navigator.webdriver + CDP detection)
└─ Cookie auth (no login form)
└─ Navigate group feed → intercept GraphQL responses passively
└─ Filter posts: trigger phrase + topic keyword − exclusions
└─ FB_DRY_RUN=true → log match only
FB_DRY_RUN=false → human_type() comment + screenshot + webhook
1. Session (scripts/fb_session.py)
Reads FB_COOKIE_FILE and FB_STATE_FILE from environment. Returns (playwright, browser, context, page).
from fb_session import create_session
pw, browser, ctx, page = await create_session()
# Raises RuntimeError if cookies are stale
2. GraphQL Interception
Passively intercept FB's internal API responses — no synthetic clicks, no DOM scraping:
responses = []
async def capture(r):
if "graphql" in r.url and r.status == 200:
try: responses.append(await r.json())
except: pass
page.on("response", capture)
await page.goto(group_url)
await asyncio.sleep(5)
See references/graphql-patterns.md for walking the response tree.
3. Human-Like Behavior (scripts/human_mouse.py)
human_scroll(page)— variable-speed wheel ticks with micro-pauseshuman_click(page, x, y)— bezier curve mouse path + hover + holdhuman_type(page, text)— variable WPM, occasional typos + backspaceidle_mouse_drift(page)— aimless drift while "reading"reading_pause(min_s, max_s)— random pre-action sleep
Timing: 3–8s after page load, 50–120s between groups, never back-to-back.
4. User Controls
import os, re
DRY_RUN = os.environ.get("FB_DRY_RUN", "true").lower() == "true"
def redact_pii(text):
"""Strip emails and phone numbers before any external send."""
text = re.sub(r'[\w.+-]+@[\w-]+\.[a-z]{2,}', '[EMAIL]', text)
text = re.sub(r'\b\d{3}[-.\s]?\d{3}[-.\s]?\d{4}\b', '[PHONE]', text)
return text
NOTIFY_WEBHOOK = os.environ.get("NOTIFY_WEBHOOK", "")
if not NOTIFY_WEBHOOK:
# Skill skips all external notifications when unset
pass
5. Post Filtering
See references/filter-logic.md — four-stage pipeline:
- Trigger phrase — hiring signal ("hiring", "looking for", "seeking", etc.)
- Topic keyword — target role ("csm", "client success manager", "retention", etc.)
- Job title exclusions — reject different roles in headline (first 200 chars)
- Seeking-work exclusions — reject service-offer posts
6. Scheduling
import schedule, time, asyncio
schedule.every().hour.at(":00").do(lambda: asyncio.run(scan_bucket("A")))
schedule.every().hour.at(":30").do(lambda: asyncio.run(scan_bucket("B")))
while True:
schedule.run_pending()
time.sleep(30)
8am–11pm only. Track seen posts in SQLite to prevent duplicate comments.
Files
| File | Purpose |
|---|---|
scripts/fb_session.py |
Cookie session factory (env vars only, no hardcoded paths) |
scripts/human_mouse.py |
Stealth mouse/scroll/type helpers (bezier curves, variable timing) |
scripts/requirements.txt |
Python dependencies (patchright>=1.0.0) |
references/graphql-patterns.md |
FB GraphQL response tree parsing guide |
references/filter-logic.md |
Keyword filter architecture + tuning guide |
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install fb-profile-control - 安装完成后,直接呼叫该 Skill 的名称或使用
/fb-profile-control触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Facebook Humanistic Profile Control 是什么?
CREDENTIALS REQUIRED: FB_COOKIE_FILE (Facebook session cookies JSON — treat as password), FB_STATE_FILE (Playwright state path, writable). Optional: FB_DRY_R... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 134 次。
如何安装 Facebook Humanistic Profile Control?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install fb-profile-control」即可一键安装,无需额外配置。
Facebook Humanistic Profile Control 是免费的吗?
是的,Facebook Humanistic Profile Control 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Facebook Humanistic Profile Control 支持哪些平台?
Facebook Humanistic Profile Control 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Facebook Humanistic Profile Control?
由 Joel Yi - DeployAIBots.com(@joelsalespossible)开发并维护,当前版本 v1.0.6。