← 返回 Skills 市场
trustydev212

Facebook Fanpage Manager

作者 Trustydev212 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
232
总下载
1
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install 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...
使用说明 (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
安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install facebook-fanpage-manager
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /facebook-fanpage-manager 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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.
元数据
Slug facebook-fanpage-manager
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

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... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 232 次。

如何安装 Facebook Fanpage Manager?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install facebook-fanpage-manager」即可一键安装,无需额外配置。

Facebook Fanpage Manager 是免费的吗?

是的,Facebook Fanpage Manager 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Facebook Fanpage Manager 支持哪些平台?

Facebook Fanpage Manager 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Facebook Fanpage Manager?

由 Trustydev212(@trustydev212)开发并维护,当前版本 v1.0.0。

💬 留言讨论