Facebook Fanpage Manager

v1.0.0

Skill quản lý Fanpage Facebook toàn diện cho OpenClaw: tự động trả lời tin nhắn Messenger, đăng bài Fanpage, reply comment, xem insights. Bao gồm hướng dẫn c...

1· 226·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for trustydev212/facebook-fanpage-manager.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Facebook Fanpage Manager" (trustydev212/facebook-fanpage-manager) from ClawHub.
Skill page: https://clawhub.ai/trustydev212/facebook-fanpage-manager
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Required env vars: FACEBOOK_PAGE_ID, FACEBOOK_ACCESS_TOKEN
Required binaries: curl
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install facebook-fanpage-manager

ClawHub CLI

Package manager switcher

npx clawhub@latest install facebook-fanpage-manager
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (manage Fanpage, Messenger auto-reply, posts, comments, insights) match the declared requirements: FACEBOOK_PAGE_ID and FACEBOOK_ACCESS_TOKEN and the use of curl to call Graph API endpoints. No unrelated credentials, binaries, or configuration paths are requested.
Instruction Scope
SKILL.md contains only Graph API calls, step-by-step setup, and guidance to store the Page ID and Page Access Token in ~/.openclaw/openclaw.json. It does not instruct exfiltration to external endpoints. Notes: (1) the included scripts use python3 for JSON parsing but the metadata does not list python3 as a required binary; (2) the provided check script prints a partial token to stdout (first 20 and last 10 chars), which could leak sensitive data if terminal/CI logs are shared; (3) the setup guide instructs obtaining App Secret and exchanging tokens via the Graph API Explorer — that is a manual/legitimate step but exposes highly sensitive secrets during the process and should be done carefully.
Install Mechanism
This is instruction-only with one small script (no download/extract/install). No installer or remote code fetch is present, so nothing additional will be written or executed beyond the included script and the user's own curl commands.
Credentials
Only FACEBOOK_PAGE_ID and FACEBOOK_ACCESS_TOKEN are required — proportional to the stated functionality. Caveats: the workflow requires the App ID/App Secret for exchanging tokens (described in the docs) but these are handled manually by the user and are not requested as env vars; storing a long-lived (or 'permanent') Page token in openclaw.json is sensitive — the skill recommends persisting that token, so users must ensure the config file is protected. The script prints token snippets to stdout which can appear in logs.
Persistence & Privilege
always is false and the skill does not request system-wide privileges. It suggests writing credentials only to the agent's own config (~/.openclaw/openclaw.json), which is expected for a skill of this type. The skill does enable autonomous actions by default (normal for skills) so an enabled skill can send messages or replies on behalf of the page.
Assessment
This skill appears to do what it says, but remember: the Page Access Token and App Secret are highly sensitive. Only install if you trust the skill and the author. Before enabling auto-reply or autonomous runs, test on a non-production page. Protect ~/.openclaw/openclaw.json (file permissions, avoid backups/logs containing tokens). Ensure python3 is available if you plan to run the included script. Never paste tokens or app secrets into public logs or chats; if a token is compromised, rotate it and remove the app from the page. Finally, be aware the skill can send messages/comments using the token — grant only the minimal permissions needed and monitor activity after enabling.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

📘 Clawdis
Binscurl
EnvFACEBOOK_PAGE_ID, FACEBOOK_ACCESS_TOKEN
latestvk972stt7ske1zfae7zfqsg8qdd83x0y3
226downloads
1stars
1versions
Updated 4w ago
v1.0.0
MIT-0

Facebook Fanpage Manager cho OpenClaw

Author: Pham Triet Cộng đồng: OpenClaw Việt Nam

Skill quản lý Fanpage Facebook toàn diện: đăng bài, reply comment, auto-reply Messenger. Bao gồm hướng dẫn lấy token từ A đến Z.

Mục lục

  1. Hướng dẫn lấy Page ID & Token (BẮT BUỘC đọc trước)
  2. Cấu hình OpenClaw
  3. Đăng bài Fanpage
  4. Reply comment
  5. Auto-reply Messenger
  6. Xem Insights

→ Đọc references/setup-guide.md để xem hướng dẫn CÓ HÌNH chi tiết từng bước. → Đọc references/api-reference.md để xem danh sách API endpoints.


1. Hướng dẫn lấy Page ID & Access Token

Đây là bước QUAN TRỌNG NHẤT — không có token thì skill không hoạt động.

→ Hướng dẫn đầy đủ có trong file references/setup-guide.md

Tóm tắt nhanh 4 bước:

Bước 1: Tạo tài khoản Meta for Developers
         → developers.facebook.com → Get Started

Bước 2: Tạo App
         → developers.facebook.com/apps → Tạo ứng dụng
         → Chọn "Tương tác với khách hàng trên Messenger"

Bước 3: Lấy Page ID + Short-lived Token
         → developers.facebook.com/tools/explorer/
         → Chọn App → Thêm quyền → Generate Access Token
         → Query "me/accounts" → lấy "id" và "access_token"

Bước 4: Đổi sang Token vĩnh viễn
         → Lấy App ID + App Secret từ Settings → Basic
         → Query đổi token (xem chi tiết trong setup-guide.md)

2. Cấu hình OpenClaw

Sau khi có Page ID và Token vĩnh viễn, cấu hình trong ~/.openclaw/openclaw.json:

{
  "skills": {
    "entries": {
      "facebook-fanpage-manager": {
        "env": {
          "FACEBOOK_PAGE_ID": "123456789012345",
          "FACEBOOK_ACCESS_TOKEN": "EAAG...your_permanent_page_token..."
        }
      }
    }
  }
}

Kiểm tra kết nối:

curl "https://graph.facebook.com/v21.0/$FACEBOOK_PAGE_ID?fields=name,followers_count" \
  -H "Authorization: Bearer $FACEBOOK_ACCESS_TOKEN"

Nếu trả về tên Fanpage và số followers → kết nối thành công.


3. Đăng bài Fanpage

Đăng bài text

curl -X POST "https://graph.facebook.com/v21.0/$FACEBOOK_PAGE_ID/feed" \
  -H "Authorization: Bearer $FACEBOOK_ACCESS_TOKEN" \
  -d "message=Nội dung bài đăng"

Đăng bài có ảnh

curl -X POST "https://graph.facebook.com/v21.0/$FACEBOOK_PAGE_ID/photos" \
  -H "Authorization: Bearer $FACEBOOK_ACCESS_TOKEN" \
  -F "url=https://example.com/image.jpg" \
  -F "caption=Nội dung kèm ảnh"

Đăng bài có link

curl -X POST "https://graph.facebook.com/v21.0/$FACEBOOK_PAGE_ID/feed" \
  -H "Authorization: Bearer $FACEBOOK_ACCESS_TOKEN" \
  -d "message=Xem thêm tại đây" \
  -d "link=https://example.com"

Lấy danh sách bài đã đăng

curl "https://graph.facebook.com/v21.0/$FACEBOOK_PAGE_ID/posts?fields=message,created_time,shares,likes.summary(true),comments.summary(true)&limit=10" \
  -H "Authorization: Bearer $FACEBOOK_ACCESS_TOKEN"

4. Reply comment

Lấy comments của bài viết

curl "https://graph.facebook.com/v21.0/{post_id}/comments?fields=from,message,created_time" \
  -H "Authorization: Bearer $FACEBOOK_ACCESS_TOKEN"

Reply một comment

curl -X POST "https://graph.facebook.com/v21.0/{comment_id}/comments" \
  -H "Authorization: Bearer $FACEBOOK_ACCESS_TOKEN" \
  -d "message=Cảm ơn bạn đã quan tâm!"

Quy trình auto-reply comment (AI soạn nội dung)

  1. Lấy danh sách bài viết mới nhất
  2. Lấy comments chưa reply
  3. Dùng AI phân tích nội dung comment
  4. Soạn reply phù hợp
  5. Gửi reply qua API

5. Auto-reply Messenger

Gửi tin nhắn cho người dùng

curl -X POST "https://graph.facebook.com/v21.0/$FACEBOOK_PAGE_ID/messages" \
  -H "Authorization: Bearer $FACEBOOK_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "recipient": {"id": "USER_PSID"},
    "message": {"text": "Xin chào! Cảm ơn bạn đã nhắn tin."}
  }'

Lấy danh sách conversations

curl "https://graph.facebook.com/v21.0/$FACEBOOK_PAGE_ID/conversations?fields=participants,messages{message,from,created_time}&limit=10" \
  -H "Authorization: Bearer $FACEBOOK_ACCESS_TOKEN"

Webhook cho Messenger (realtime auto-reply)

Để nhận tin nhắn realtime, cần setup webhook. Xem chi tiết trong references/setup-guide.md phần "Setup Webhook".

Lưu ý: Webhook cần server chạy liên tục (VPS, ngrok, hoặc Cloudflare Tunnel). Nếu không có server, vẫn có thể dùng cách polling (lấy tin nhắn định kỳ).

Cách polling (không cần webhook)

# Lấy tin nhắn mới mỗi 30 giây
curl "https://graph.facebook.com/v21.0/$FACEBOOK_PAGE_ID/conversations?fields=messages.limit(1){message,from,created_time}&limit=5" \
  -H "Authorization: Bearer $FACEBOOK_ACCESS_TOKEN"

Quy trình polling:

  1. Cứ mỗi 30–60 giây, lấy danh sách conversations mới
  2. Kiểm tra tin nhắn chưa reply
  3. Dùng AI soạn reply
  4. Gửi reply qua Send API

6. Xem Insights

Thống kê Fanpage

curl "https://graph.facebook.com/v21.0/$FACEBOOK_PAGE_ID/insights?metric=page_impressions,page_engaged_users,page_fans&period=day" \
  -H "Authorization: Bearer $FACEBOOK_ACCESS_TOKEN"

Thống kê bài viết

curl "https://graph.facebook.com/v21.0/{post_id}/insights?metric=post_impressions,post_engaged_users,post_clicks" \
  -H "Authorization: Bearer $FACEBOOK_ACCESS_TOKEN"

Lưu ý quan trọng

  • Token vĩnh viễn vẫn có thể hết hạn nếu: đổi mật khẩu Facebook, gỡ quyền App, hoặc App bị vô hiệu hóa. Khi đó cần lấy token mới.
  • Rate limit: Facebook giới hạn khoảng 200 requests/giờ. Không gọi API quá nhiều.
  • Quyền cần có: pages_show_list, pages_messaging, pages_manage_metadata, pages_manage_posts, pages_read_engagement.
  • App Mode: App phải ở chế độ Live (không phải Development) để hoạt động với người dùng khác.

Cấu trúc thư mục skill

facebook-fanpage-manager/
├── SKILL.md                    ← File này
├── references/
│   ├── setup-guide.md          ← Hướng dẫn lấy token từng bước chi tiết
│   └── api-reference.md        ← Danh sách API endpoints
└── scripts/
    └── check-connection.sh     ← Script kiểm tra kết nối

Comments

Loading comments...