← Back to Skills Marketplace
phuc-nt

Facebook Group Monitor

by phuc-nt · GitHub ↗ · v1.3.0 · MIT-0
cross-platform ✓ Security Clean
429
Downloads
1
Stars
1
Active Installs
3
Versions
Install in OpenClaw
/install facebook-group-monitor
Description
Monitor Facebook groups for new posts using Playwright browser automation with stealth mode and persistent login session. Scrapes group feed, tracks seen pos...
README (SKILL.md)

Facebook Group Monitor Skill

Overview

Playwright-based headless browser scraper for Facebook groups. Default behavior: captures a stitched "feed strip" (scrolls 3× viewport, crops to feed column, stitches into 1 JPEG) → agent calls vision model once with a custom prompt to extract and interpret all new posts in a single LLM call.

Requires one-time manual login via terminal to establish a persistent browser session.

Setup

See references/SETUP.md for installation and first-time login instructions.

File Locations (after install)

  • Script: scripts/fb-group-monitor.py
  • Shell wrapper: scripts/fb-group-monitor.sh
  • Browser session: auto-created at scripts/.browser-data/ (persistent login)
  • Seen posts: auto-created at scripts/.seen-posts.json (dedup tracking)
  • Screenshots: scripts/screenshots/ or custom --shots-dir

Commands

1. Check login session

scripts/fb-group-monitor.sh status

Output:

{"success": true, "action": "status", "message": "Session active — logged in to Facebook."}

2. Scrape new posts (with feed strip screenshot)

scripts/fb-group-monitor.sh scrape \x3CGROUP_URL> [--limit N] [--shots-dir \x3CPATH>]

Parameters:

  • GROUP_URL: Full URL (https://www.facebook.com/groups/123456) or just group ID
  • --limit N: Max posts to scrape (default: 10)
  • --shots-dir \x3CPATH>: ⚠️ REQUIRED for vision — save screenshots in agent workspace so image tool can read them
  • --no-shots: Skip screenshots (faster, text-only mode)

Example:

scripts/fb-group-monitor.sh scrape "https://www.facebook.com/groups/123456789" --limit 10 --shots-dir ./temp-screenshots

Output JSON (with feed strip screenshot):

{
  "success": true,
  "action": "scrape",
  "group_name": "Example Group Name",
  "group_url": "https://www.facebook.com/groups/123456789",
  "total_scraped": 6,
  "new_count": 3,
  "feed_screenshot": "/path/to/temp-screenshots/feed_abc12345_1741800000.jpg",
  "posts": [
    {
      "author": "Poster Name",
      "text": "Post content (may be truncated by Facebook's 'See more')...",
      "url": "https://facebook.com/groups/123456/posts/789",
      "images": 3
    },
    {
      "author": "Another Poster",
      "text": "Text-only post, no images...",
      "url": "https://facebook.com/groups/123456/posts/790",
      "images": 0
    }
  ],
  "message": "Found 3 new posts / 6 total."
}

Note: feed_screenshot is a single stitched JPEG covering the full feed (3 viewport scrolls). Individual posts no longer have a screenshot_path — use feed_screenshot (top-level) instead.

3. Clean old screenshots

scripts/fb-group-monitor.sh clean-shots

Auto-removes screenshots older than 48h and caps at 100 max. Script also auto-cleans before each scrape.

4. Login (one-time, from terminal)

scripts/fb-group-monitor.sh login

Opens browser, login manually, press Enter to save session. Session lasts weeks/months.

Agent Workflow

When triggered by cron or user request to check a group:

Step 1: Scrape

scripts/fb-group-monitor.sh scrape "\x3CGROUP_URL>" --limit 10 --shots-dir ./temp-screenshots

⚠️ Use --shots-dir pointing to a path within the workspace so the image tool can access screenshots.

Step 2: Analyze feed screenshot + combine with text

If feed_screenshot is present (1 stitched image covering the full feed):

  • Compose a dynamic prompt using the author list from the JSON, so vision focuses on the correct new posts (the feed strip also contains already-seen posts)
  • Call image tool with both image and prompt parameters:
    image tool:
      image: \x3Cfeed_screenshot path>
      prompt: "Facebook group feed. Find and analyze posts by these people (new posts to process):
      - [Author 1]: "[first few words of text from JSON]" — N images
      - [Author 2]: "[first few words of text from JSON]"
      ...
      For EACH post, do 2 things:
      1. EXTRACT: book/product name, author/publisher (read from cover), price (including handwritten prices), condition (new/used/marked/yellowed).
      2. INTERPRET: is the deal worth it (price vs market if known), is the item rare/valuable, actual condition assessment from photos."
    
  • ⚠️ NEVER call image tool with empty {} — default prompt just describes the image generically
  • ⚠️ Feed strip includes old posts — always include author + text snippet so vision targets the right posts
  • After getting vision result: match by author, add url from JSON
  • Prioritize image content over truncated text field ("see more" posts)

If feed_screenshot is absent (screenshot failed):

  • Read directly from text field of each post
  • Summarize available information, note "no screenshot available"

Step 3: Report to user

MUST include the original post link in each item for verification.

Format per new post:

📌 *[Title/Summary]*
👤 Author: [author]
💰 Price: [price or "unknown"]
📝 Condition: [description]
💡 Note: [deal assessment or insight, if any]
🔗 [post URL]

Step 4: If no new posts → stay silent (no notification)

Step 5: If success == false → report error briefly

⚠️ Anti-duplicate rule

  • Send Telegram only ONCE per run, regardless of whether vision succeeded or failed
  • If message tool returns an error → report once and stop, do NOT retry
  • If vision fails → fallback to text, send once with note "⚠️ Vision unavailable, text only"

Important Notes

  • Rate limiting: Recommended cron interval ≥ 2 hours — safe for Facebook
  • Session expired: If error "Not logged in" → run login from terminal
  • UI changes: Facebook updates DOM frequently → selectors may need updates
  • "See more": Text is truncated — feed strip screenshot usually has complete content
  • Feed strip: Scrolls 3× viewport height, crops to feed column, stitches 1 JPEG — reduces vision calls from N to 1
  • Screenshot quality: JPEG 82% — sufficient for LLM vision to read text and identify product images
  • Vision model: Use a vision-capable model (e.g. Gemini Flash) for the image tool call
Usage Guidance
This skill appears to do exactly what it says: it automates a Chromium browser (Playwright) to log into Facebook (manual interactive login once), persist the browser session to scripts/.browser-data, scrape group posts, and save stitched screenshots in a workspace folder for vision-analysis. Before installing: 1) understand that the saved session directory contains Facebook auth cookies — treat it as sensitive and store it in a location you control or remove it when not needed; 2) perform the one-time login interactively on a trusted machine (do not give credentials to the agent); 3) consider using a dedicated Facebook account for scraping to limit exposure; 4) the skill will write screenshots and a .seen-posts.json file in its scripts folder (or in the workspace you point via --shots-dir) — review those files if you are concerned about local data retention; 5) installing dependencies will fetch Playwright and Chromium via their normal channels (pip/playwright install); review and run those commands yourself in a virtualenv rather than letting an agent run them. If you want stronger isolation, run this skill inside a constrained environment or VM and inspect scripts/fb-group-monitor.py yourself before use.
Capability Analysis
Type: OpenClaw Skill Name: facebook-group-monitor Version: 1.3.0 The skill is a legitimate Facebook group monitoring tool that uses Playwright for browser automation and Pillow for image stitching. It features a robust scraping logic (fb-group-monitor.py) that extracts post data and generates 'feed strip' screenshots for LLM vision analysis, while maintaining a persistent login session to avoid credential handling risks. The instructions in SKILL.md are well-aligned with the stated purpose, providing clear guidance for the agent on data extraction and analysis without any signs of malicious intent or data exfiltration.
Capability Assessment
Purpose & Capability
Name/description, SKILL.md, setup guide, and included scripts all describe a Playwright-based Facebook group scraper that uses a persistent browser session and stitched screenshots. The files and requested behaviors are consistent with that purpose; no unrelated credentials, services, or binaries are requested.
Instruction Scope
Runtime instructions require storing a persistent Playwright user-data directory (cookies/session) under scripts/.browser-data, saving screenshots into a workspace path so the agent's image tool can read them, and writing a seen-posts file. Those actions are expected for this skill but expose Facebook session cookies and scraped images on disk — the README correctly instructs first-time interactive login from a terminal rather than from the agent.
Install Mechanism
No install spec is embedded in the registry (instruction-only), but SETUP.md instructs installing well-known packages (playwright, playwright-stealth) and running 'playwright install chromium'. Playwright downloads Chromium from its standard release sources — no arbitrary external binaries or obscure URLs are referenced.
Credentials
The skill does not declare or require external API keys or secrets. It optionally reads FBMON_VENV to locate a virtualenv (a normal convenience). The persistent browser session effectively holds Facebook authentication cookies — sensitive but proportional and necessary for the stated functionality.
Persistence & Privilege
always is false and the skill does not change other skills' configuration. However, with a saved session in scripts/.browser-data, the agent (when invoked autonomously or via cron) can scrape Facebook groups without further manual interaction; users should be aware that saved session cookies grant ongoing access until the session expires or is cleared.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install facebook-group-monitor
  3. After installation, invoke the skill by name or use /facebook-group-monitor
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.3.0
v1.3.0: New feed strip workflow — dynamic vision prompt from JSON authors, anti-duplicate guard, updated output schema (feed_screenshot top-level). Resolves vision mismatch issue where model described wrong posts.
v1.1.0
Fix URL extraction: 4-pass strategy improves post link detection from 64% to 100%. Adds isPostLink() helper, broad anchor scan (Pass 2), timestamp aria-label fallback (Pass 3), and post ID extraction from photo set param (Pass 4).
v1.0.0
Initial release: Playwright-based FB group scraper with stealth mode and screenshot capture for LLM vision analysis
Metadata
Slug facebook-group-monitor
Version 1.3.0
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 3
Frequently Asked Questions

What is Facebook Group Monitor?

Monitor Facebook groups for new posts using Playwright browser automation with stealth mode and persistent login session. Scrapes group feed, tracks seen pos... It is an AI Agent Skill for Claude Code / OpenClaw, with 429 downloads so far.

How do I install Facebook Group Monitor?

Run "/install facebook-group-monitor" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Facebook Group Monitor free?

Yes, Facebook Group Monitor is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Facebook Group Monitor support?

Facebook Group Monitor is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Facebook Group Monitor?

It is built and maintained by phuc-nt (@phuc-nt); the current version is v1.3.0.

💬 Comments