← Back to Skills Marketplace
trustydev212

Facebook Manager

by Trustydev212 · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ⚠ suspicious
157
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install facebook-manager
Description
Skill quản lý Facebook toàn diện cho OpenClaw: hỗ trợ CẢ Fanpage (Page Token) VÀ tài khoản cá nhân (User Token). Fanpage: đăng bài, reply comment, auto-reply...
README (SKILL.md)

Facebook Manager v2 cho OpenClaw

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

Skill quản lý Facebook toàn diện — hỗ trợ 2 chế độ token:

Chọn chế độ nào?

Nhu cầu Chế độ Token
Quản lý Fanpage (đăng bài, reply, Messenger, insights) Page Page Access Token (vĩnh viễn)
Tìm nhóm, đọc bài nhóm, tìm trang khác, search bài viết User User Access Token (~60 ngày)
Cả hai Cả hai Cấu hình 2 token riêng

→ Đọc references/setup-guide.md để lấy token từng bước.


So sánh quyền Page Token vs User Token

Tính năng Page Token User Token
Đăng bài Fanpage ✅ (nếu là admin)
Reply comment trên Fanpage
Gửi tin nhắn Messenger
Xem Insights Fanpage
Tìm nhóm Facebook
Đọc bài trong nhóm (là thành viên)
Tìm trang/Fanpage khác
Tìm kiếm bài viết công khai ✅ (hạn chế)
Đọc thông tin cá nhân
Hết hạn Vĩnh viễn ~60 ngày

Cấu hình OpenClaw

{
  "skills": {
    "entries": {
      "facebook-manager": {
        "env": {
          "FACEBOOK_PAGE_ID": "123456789012345",
          "FACEBOOK_PAGE_TOKEN": "EAAG...page_token_vinh_vien...ZD",
          "FACEBOOK_USER_TOKEN": "EAAG...user_token_60_ngay...ZD"
        }
      }
    }
  }
}

Chỉ cần token nào bạn dùng — không bắt buộc cả hai.


CHẾ ĐỘ 1: QUẢN LÝ FANPAGE (Page Token)

Đăng bài

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

# Đăng bài có ảnh
curl -X POST "https://graph.facebook.com/v22.0/$FACEBOOK_PAGE_ID/photos" \
  -H "Authorization: Bearer $FACEBOOK_PAGE_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/v22.0/$FACEBOOK_PAGE_ID/feed" \
  -H "Authorization: Bearer $FACEBOOK_PAGE_TOKEN" \
  -d "message=Xem thêm tại đây" -d "link=https://example.com"

Reply comment

# Lấy comments
curl "https://graph.facebook.com/v22.0/{post_id}/comments?fields=from,message,created_time" \
  -H "Authorization: Bearer $FACEBOOK_PAGE_TOKEN"

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

Auto-reply Messenger

# Gửi tin nhắn
curl -X POST "https://graph.facebook.com/v22.0/$FACEBOOK_PAGE_ID/messages" \
  -H "Authorization: Bearer $FACEBOOK_PAGE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"recipient":{"id":"USER_PSID"},"message":{"text":"Xin chào!"}}'

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

Xem Insights

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

CHẾ ĐỘ 2: TÌM KIẾM & NHÓM (User Token)

Tìm nhóm Facebook

# Tìm nhóm theo từ khóa
curl "https://graph.facebook.com/v22.0/search?q=BDS+Da+Lat&type=group&limit=10" \
  -H "Authorization: Bearer $FACEBOOK_USER_TOKEN"

# Lấy danh sách nhóm đã tham gia
curl "https://graph.facebook.com/v22.0/me/groups?fields=name,member_count,privacy&limit=20" \
  -H "Authorization: Bearer $FACEBOOK_USER_TOKEN"

Đọc bài trong nhóm (phải là thành viên)

# Lấy bài viết trong nhóm
curl "https://graph.facebook.com/v22.0/{group_id}/feed?\
fields=message,from,created_time,attachments&limit=20" \
  -H "Authorization: Bearer $FACEBOOK_USER_TOKEN"

Tìm trang/Fanpage khác

# Tìm trang theo từ khóa
curl "https://graph.facebook.com/v22.0/search?q=BDS+Da+Lat&type=page&limit=10&\
fields=name,fan_count,category,link" \
  -H "Authorization: Bearer $FACEBOOK_USER_TOKEN"

# Lấy bài viết của trang công khai
curl "https://graph.facebook.com/v22.0/{page_id}/posts?\
fields=message,created_time,likes.summary(true)&limit=10" \
  -H "Authorization: Bearer $FACEBOOK_USER_TOKEN"

Tìm kiếm bài viết công khai

# Tìm bài viết công khai theo từ khóa (hạn chế theo chính sách Meta)
curl "https://graph.facebook.com/v22.0/search?q=cho+thue+phong+Da+Lat&type=post&limit=10" \
  -H "Authorization: Bearer $FACEBOOK_USER_TOKEN"

⚠️ Facebook hạn chế search API rất nhiều từ 2018. Nếu bị lỗi (#11) Search is not supported, dùng cách khác: tìm nhóm → đọc bài trong nhóm → lọc theo nội dung.

Ví dụ thực tế: Tìm BĐS cho thuê Đà Lạt

Bước 1: Tìm nhóm BĐS Đà Lạt
  → search?q=BDS+cho+thue+Da+Lat&type=group

Bước 2: Lấy bài mới trong nhóm
  → {group_id}/feed?fields=message,created_time&limit=20

Bước 3: AI lọc bài liên quan (cho thuê, giá, khu vực)
  → Agent phân tích nội dung, tóm tắt cho user

Quyền cần thiết

Cho Page Token (quản lý Fanpage)

pages_show_list           ← Xem danh sách fanpage
pages_messaging           ← Gửi/nhận tin nhắn Messenger
pages_manage_metadata     ← Quản lý metadata fanpage
pages_manage_posts        ← Đăng bài, xóa bài
pages_read_engagement     ← Đọc likes, comments, shares
pages_read_user_content   ← Đọc nội dung user post trên page
pages_manage_engagement   ← Reply comment, like comment

Cho User Token (tìm kiếm, nhóm)

public_profile            ← Mặc định (luôn có)
user_posts                ← Đọc bài viết cá nhân
groups_access_member_info ← Đọc thông tin nhóm + bài trong nhóm
pages_show_list           ← Tìm trang

Lưu ý quan trọng

Facebook cá nhân KHÔNG có API đăng bài

Facebook đã xóa quyền publish_actions từ 2018. KHÔNG thể đăng bài lên tường cá nhân qua API. Chỉ có thể đăng bài lên Fanpage (qua Page Token).

User Token hết hạn 60 ngày

Cần refresh định kỳ. Xem references/setup-guide.md phần "Refresh User Token".

Rate limit

  • Page Token: ~200 requests/giờ
  • User Token: ~200 requests/giờ
  • Nếu bị rate limit: giảm tần suất, dùng batch requests, cache kết quả

App Mode

App phải ở chế độ Live để hoạt động với người dùng khác. App ở chế độ Development chỉ admin/tester mới dùng được.


Cấu trúc thư mục

facebook-manager/
├── SKILL.md                    ← File này
├── references/
│   ├── setup-guide.md          ← Hướng dẫn lấy cả 2 loại token
│   └── api-reference.md        ← Danh sách API endpoints đầy đủ
└── scripts/
    └── check-connection.sh     ← Kiểm tra kết nối (cả Page + User)
Usage Guidance
Do not install or provide secrets until these inconsistencies are resolved. Ask the author to: (1) update the registry metadata to list all env vars the skill actually needs (FACEBOOK_PAGE_TOKEN, FACEBOOK_USER_TOKEN, FACEBOOK_PAGE_ID, APP_ID, APP_SECRET), or change SKILL.md to match the declared variable; (2) explain why APP_SECRET is needed and whether the token-refresh step can be performed manually instead; (3) confirm whether the skill will write to ~/.openclaw/openclaw.json and offer an opt-out; (4) avoid storing App Secret in plaintext if possible and document access controls. If you do proceed, provide only the minimal token necessary (prefer a page-scoped token with least privilege), avoid giving APP_SECRET to untrusted code, and consider running the included scripts manually after reviewing them.
Capability Analysis
Type: OpenClaw Skill Name: facebook-manager Version: 1.0.1 The skill is a legitimate tool for managing Facebook Fanpages and interacting with the Graph API. It provides standard functionality for posting, replying to comments, and searching groups using official Facebook endpoints (graph.facebook.com). While it handles sensitive access tokens and includes a script (setup-guide.md) that can modify the local OpenClaw configuration to refresh tokens, these actions are well-documented, aligned with the skill's purpose, and do not show signs of data exfiltration or unauthorized execution.
Capability Assessment
Purpose & Capability
Skill claims to manage Facebook (pages, messenger, groups) which legitimately needs Facebook tokens and curl; however the registry only declares FACEBOOK_ACCESS_TOKEN while the README and scripts use FACEBOOK_PAGE_TOKEN, FACEBOOK_USER_TOKEN, FACEBOOK_PAGE_ID, and the setup guide instructs obtaining APP_ID and APP_SECRET. The declared requirements do not match the actual required credentials.
Instruction Scope
SKILL.md includes step-by-step API calls, a token refresh script, and explicit instructions to store tokens and App Secret; the refresh script and examples reference writing to ~/.openclaw/openclaw.json and use APP_ID/APP_SECRET (not declared). The instructions therefore direct the agent to handle and persist multiple secrets and to modify an agent config file — actions beyond simple API call examples.
Install Mechanism
This is an instruction-only skill with no install spec (no code fetched from the network at install time). The only code file is a small local shell script. Lack of an installer reduces installation-time risk.
Credentials
Registry lists a single required env var (FACEBOOK_ACCESS_TOKEN) but the skill expects and documents several env vars including FACEBOOK_PAGE_TOKEN, FACEBOOK_USER_TOKEN, FACEBOOK_PAGE_ID, APP_ID, APP_SECRET. Requesting APP_SECRET or telling users to store it is sensitive and not declared; asking for multiple unrelated secrets without declaring them is disproportionate and inconsistent.
Persistence & Privilege
The skill's refresh script suggests storing refreshed tokens into ~/.openclaw/openclaw.json (it updates the skill's own entry). Modifying the agent's config to persist tokens is plausible for this use case, but it creates long-lived secrets on disk and suggests setting a cronjob. This increases persistence and blast radius if tokens are compromised. The skill does not set always: true.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install facebook-manager
  3. After installation, invoke the skill by name or use /facebook-manager
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
**Big update: Skill đổi tên thành facebook-manager và hỗ trợ cả Fanpage (Page Token) lẫn tài khoản cá nhân (User Token).** - Hỗ trợ đồng thời Page Token (quản lý Fanpage) và User Token (tìm nhóm, đọc bài nhóm, tìm trang, search bài công khai). - Thêm hướng dẫn cấu hình hai loại token, dùng linh hoạt cho từng tính năng. - Tổng hợp và so sánh quyền hạn cũng như giới hạn của từng loại token. - Bổ sung tài liệu, ví dụ và cảnh báo về hạn chế API tìm kiếm, rate limit, giới hạn và thời hạn của từng loại token. - Sửa đổi ví dụ API cho cả 2 chế độ sử dụng (Fanpage và tài khoản cá nhân).
Metadata
Slug facebook-manager
Version 1.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Facebook Manager?

Skill quản lý Facebook toàn diện cho OpenClaw: hỗ trợ CẢ Fanpage (Page Token) VÀ tài khoản cá nhân (User Token). Fanpage: đăng bài, reply comment, auto-reply... It is an AI Agent Skill for Claude Code / OpenClaw, with 157 downloads so far.

How do I install Facebook Manager?

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

Is Facebook Manager free?

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

Which platforms does Facebook Manager support?

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

Who created Facebook Manager?

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

💬 Comments