Golden Hour Automator
This skill provides the script and instructions needed to run a comment-to-DM automation on Instagram. It is designed to boost engagement in the critical first hour (the "Golden Hour") after a post goes live.
Prerequisites
The user must have:
- 1. An Instagram Professional/Business account linked to a Facebook Page.
- A Long-Lived Instagram Graph API Page Access Token (
IG_ACCESS_TOKEN). - Their Instagram Business Account ID (
IG_ACCOUNT_ID).
Ensure these are set in the environment or .env file before running the script.
Usage
When a user asks to monitor a post for a keyword and send a DM, run the included ig_golden_hour.py script.
CODEBLOCK0
Parameters:
- -
--media_id: The ID of the specific Instagram post/Reel to monitor. (You may need to query the Graph API me/media endpoint to find this for the user's latest post). - INLINECODE6 : The trigger word the script watches for in the comments (case-insensitive).
- INLINECODE7 : The exact message to send to the user's DMs.
- INLINECODE8 : How many minutes the script should stay alive and monitor the post (default is 60).
What the Script Does:
- 1. Polls the comments of the specified
media_id every 2 minutes. - If it finds the
--keyword, it sends the --dm_text directly to the commenter's inbox using the Meta me/messages endpoint. - It posts a public reply to the comment ("Just sent you a DM with the link! 🚀") to double the post's comment count and boost algorithmic reach.
- It sends a success notification back to OpenClaw via the
openclaw message CLI.
技能名称:黄金时段自动回复
黄金时段自动回复
该技能提供在Instagram上运行评论转私信自动化所需的脚本和操作说明。旨在帖子发布后的关键第一小时(黄金时段)提升互动率。
前置条件
用户必须满足:
- 1. 拥有与Facebook主页关联的Instagram专业/商业账号。
- 获取长期有效的Instagram图谱API页面访问令牌(IGACCESSTOKEN)。
- 获取Instagram商业账号ID(IGACCOUNTID)。
运行脚本前,请确保在环境变量或.env文件中设置这些参数。
使用方法
当用户要求监控帖子的关键词并发送私信时,运行附带的iggoldenhour.py脚本。
bash
uv run {baseDir}/scripts/iggoldenhour.py \
--media_id 12345678901234567 \
--keyword 机器人 \
--dm_text 这是您请求的链接:https://example.com \
--duration 60
参数说明:
- - --mediaid:需要监控的特定Instagram帖子/Reels的ID。(可能需要查询图谱API的me/media端点来获取用户最新帖子的ID)
- --keyword:脚本在评论中监控的触发词(不区分大小写)。
- --dmtext:发送至用户私信的精确消息内容。
- --duration:脚本保持运行并监控帖子的时长(默认60分钟)。
脚本功能:
- 1. 每2分钟轮询指定mediaid的评论。
- 若发现--keyword,则通过Meta的me/messages端点将--dmtext直接发送至评论者的收件箱。
- 在评论下公开发布回复(已将链接通过私信发送给您!🚀),使帖子评论数翻倍并提升算法推荐权重。
- 通过openclaw message命令行工具向OpenClaw发送成功通知。