← Back to Skills Marketplace
trustydev212

Facebook Fanpage Manager

by Trustydev212 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
232
Downloads
1
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install facebook-fanpage-manager
Description
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...
README (SKILL.md)

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
Usage Guidance
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.
Capability Analysis
Type: OpenClaw Skill Name: facebook-fanpage-manager Version: 1.0.0 The skill is a legitimate tool for managing Facebook Fanpages via the official Graph API. It provides clear documentation, a connection verification script (scripts/check-connection.sh), and detailed instructions for obtaining the necessary credentials (references/setup-guide.md). All network requests are directed to graph.facebook.com, and no evidence of data exfiltration, malicious execution, or prompt injection was found.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install facebook-fanpage-manager
  3. After installation, invoke the skill by name or use /facebook-fanpage-manager
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of Facebook Fanpage Manager for OpenClaw. - Comprehensive Facebook Fanpage management: auto-reply Messenger, post to Fanpage, reply to comments, and view insights. - Detailed step-by-step guides for obtaining Page ID and permanent Page Access Token. - Includes examples for posting (text, image, link), replying comments, sending/replying Messenger messages, and viewing analytics. - Setup instructions and requirements provided for easy integration into OpenClaw. - Vietnamese documentation and user-oriented implementation.
Metadata
Slug facebook-fanpage-manager
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Facebook Fanpage Manager?

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... It is an AI Agent Skill for Claude Code / OpenClaw, with 232 downloads so far.

How do I install Facebook Fanpage Manager?

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

Is Facebook Fanpage Manager free?

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

Which platforms does Facebook Fanpage Manager support?

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

Who created Facebook Fanpage Manager?

It is built and maintained by Trustydev212 (@trustydev212); the current version is v1.0.0.

💬 Comments