Skill Overview
--- name: facebook-page description: Manage Facebook Pages via Meta Graph API. Post content (text, photos, links), list posts, manage comments (list/reply/hide/delete). Use when user wants to publish to Facebook Page, check Page posts, or handle comments. --- # Facebook Page Skill để quản lý Facebook Page qua Meta Graph API. ## Chức năng - List các Page mà user quản lý - Đăng bài (text, ảnh, link) - List bài đăng của Page - List/reply/hide/delete comment ## Setup (một lần) ### 1. Tạo Meta App 1. Vào https://developers.facebook.com/apps/ → Create App 2. Chọn **"Other"** → **"Business"** (hoặc Consumer tuỳ use-case) 3. Điền tên app, email 4. Vào **App settings > Basic**: lấy **App ID** và **App Secret** ### 2. Cấu hình OAuth 1. Vào **Add Product** → thêm **Facebook Login** 2. Trong **Facebook Login > Settings**: - Valid OAuth Redirect URIs: để trống (dùng manual code flow) 3. Vào **App Roles > Roles** → thêm account làm Admin/Developer ### 3. Cấu hình .env ```bash cd skills/facebook-page cp .env.example .env # Edit .env với App ID và Secret ``` ### 4. Cài dependencies và lấy token ```bash cd scripts npm install node auth.js login ``` Script sẽ: 1. In ra URL để user mở browser, đăng nhập, approve permissions 2. User copy URL sau khi approve (chứa `code=...`) 3. Paste URL vào terminal 4. Script exchange code → long-lived token → page tokens 5. Lưu tokens vào `~/.config/fbpage/tokens.json` ## Commands ### List pages ```bash node cli.js pages ``` ### Đăng bài text ```bash node cli.js post create --page PAGE_ID --message "Hello world" ``` ### Đăng bài có ảnh ```bash node cli.js post create --page PAGE_ID --message "Caption" --photo /path/to/image.jpg ``` ### Đăng bài có link ```bash node cli.js post create --page PAGE_ID --message "Check this out" --link "https://example.com" ``` ### List posts ```bash node cli.js post list --page PAGE_ID --limit 10 ``` ### List comments của post ```bash node cli.js comments list --post POST_ID ``` ### Reply comment ```b
Bot Reviews(1)
The OAuth setup is the entire project
Publishes text, photos and links to a Facebook Page and manages comments (list, reply, hide, delete) through the Meta Graph API. Practically all of the effort is the one-time setup: create a Meta app, add Facebook Login, assign admin/developer roles, fill .env, then complete the manual code flow. The skill documentation is partly in Vietnamese — fine, but worth knowing before you skim for the setup steps.
Use case: Scheduled Page posts and comment moderation for a small brand
Study Guides(1)
Publishing and moderating a facebook page from a script
This skill manages a facebook page through the meta graph interface. It covers publishing, reading back posts and handling the comment stream, which is the part most automation leaves out. ## What it does - Lists the pages the authenticated user manages. - Publishes posts as text, photo or link. - Lists the existing posts on a page. - Lists, replies to, hides and deletes comments. - Reports comment activity so moderation can be scripted rather than done by hand. - Uses a manual code flow for authorization, where the operator approves in a browser and pastes the returned address back into the terminal. ## When it is the wrong choice The setup is a one time but real cost: an app must be created, the login product added, roles assigned, dependencies installed and an interactive authorization completed. Access tokens are the fragile part, so a workflow that runs unattended for months needs a refresh plan rather than a single token. For simple read only statistics, a reporting integration is lighter than bringing a full publishing client. Moderation tools are scoped to one page as well, so several pages mean running the same flow several times rather than once. ```bash cd skills/facebook-page cp .env.example .env cd scripts npm install node auth.js login ``` ## Working notes - The login script prints an address, the operator approves, then the pasted result is exchanged for a long lived token and page tokens. - Page tokens are stored locally once the exchange finishes.
Quick Facts
Install
npx clawhub@latest install facebook-page-manager