返回顶部
a

ai-agent

Facebook Publisher Skill (Automate Page Posts via Graph API)

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
143
下载量
0
收藏
概述
安装方式
版本历史

ai-agent

# Facebook Graph API Skill (Advanced) ## Purpose Production-oriented guide for building Facebook Graph API workflows for Pages: publishing posts (text + image), managing tokens, and operating Page content safely using direct HTTPS calls. ## Best fit - Page posting automation with images (DALL-E generated or external URL) - Token management (short-lived → long-lived → page token) - Retry-safe, rate-limit-aware production pipelines ## Not a fit - Personal profile posting (not supported by Graph API for third-party apps) - Ads / Marketing API workflows - Browser-based OAuth flows ## Quick orientation ``` agents/fb_token_helper.py ← Get & exchange tokens (run this first!) agents/fb_publisher_agent.py ← Post text / images to Page config.py ← All env vars test_fb_connection.py ← Verify token is working ``` ## Token Flow ``` Short-lived User Token (1-2h) ↓ GET /oauth/access_token?grant_type=fb_exchange_token Long-lived User Token (60 days) ↓ GET /me/accounts Page Access Token (never expires*) ``` *Until user changes password or revokes app. ## Required Environment Variables ```env FB_APP_ID=... # From Meta for Developers FB_APP_SECRET=... # App secret FB_PAGE_ID=... # Target Fanpage ID FB_PAGE_ACCESS_TOKEN=... # From fb_token_helper.py ``` ## Key API Endpoints ### Post text ``` POST /v21.0/{page_id}/feed message=... access_token={page_token} ``` ### Upload photo (unpublished) ``` POST /v21.0/{page_id}/photos url={image_url} published=false access_token={page_token} → Returns: { "id": "PHOTO_ID" } ``` ### Post with photo ``` POST /v21.0/{page_id}/feed message=... attached_media[0]={"media_fbid":"PHOTO_ID"} access_token={page_token} ``` ### Scheduled post ``` POST /v21.0/{page_id}/feed message=... scheduled_publish_time={unix_timestamp} published=false access_token={page_token} ``` ## Required Permissions | Permission | Purpose | |-----------|---------| | `pages_manage_posts` | Create/edit posts | | `pages_read_engagement` | Read reactions, comments | | `pages_show_list` | List managed pages | | `public_profile` | Basic user identity | ## Rate Limits - 200 calls/hour/user token - Implement retry with exponential backoff (see fb_publisher_agent.py) - POST 4-5 times/day max per Page for safety ## Security - Never log tokens or app secrets - Store all secrets in .env (ignored by git) - Validate webhook signatures if using webhooks - Monitor token validity daily with a cron job

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 qwe-1776095341 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 qwe-1776095341 技能

通过命令行安装

skillhub install qwe-1776095341

下载 Zip 包

⬇ 下载 ai-agent v1.0.0

文件大小: 8.43 KB | 发布时间: 2026-4-17 15:53

v1.0.0 最新 2026-4-17 15:53
qsadasd

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部