Facebook Group Monitor
by @phuc-nt
Monitor Facebook groups for new posts using Playwright browser automation with stealth mode and persistent login session. Scrapes group feed, tracks seen pos...
clawhub install facebook-group-monitorπ About This Skill
name: 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 posts, reports only new ones. Captures a single stitched "feed strip" screenshot (viewport scroll + Pillow stitch) for efficient LLM vision analysis β one image covers the full feed. Use when: monitoring Facebook groups, scraping FB posts, checking new group activity, Facebook automation, marketplace monitoring, book sale tracking, competitor group monitoring. Triggers: 'check Facebook group', 'scrape FB posts', 'new posts in group', 'monitor group', 'Facebook marketplace', 'group update'. metadata: openclaw: category: "social" shared: true
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)
scripts/fb-group-monitor.pyscripts/fb-group-monitor.shscripts/.browser-data/ (persistent login)scripts/.seen-posts.json (dedup tracking)scripts/screenshots/ or custom --shots-dirCommands
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 [--limit N] [--shots-dir ]
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 : β οΈ 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 "" --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):
image and prompt parameters: image tool:
image:
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."
{} β default prompt just describes the image genericallyurl from JSONtext field ("see more" posts)If feed_screenshot is absent (screenshot failed):
text field of each postStep 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
message tool returns an error β report once and stop, do NOT retryImportant Notes
login from terminalβοΈ Configuration
See references/SETUP.md for installation and first-time login instructions.