@fwgi/openclaw-x-marketing 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -0
- package/SKILL.md +140 -0
- package/docs/ref-tools.md +369 -0
- package/docs/ref-workflow.md +193 -0
- package/index.ts +882 -0
- package/openclaw.plugin.json +43 -0
- package/package.json +26 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
# X Marketing 工作流参考
|
|
2
|
+
|
|
3
|
+
> 版本:v4.0.0 | 认证方式:x-api-key
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 工作流总览
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
验证连接 → 查看账号 → 受众管理(导入/筛选/分组/标签/活动)
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 1. 会话初始化
|
|
16
|
+
|
|
17
|
+
每次对话开始时先确认连接:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
x_verify_connection
|
|
21
|
+
→ ✅ 通过 → 继续
|
|
22
|
+
→ ❌ 失败 → 引导用户检查 API Key
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 2. 账号信息查看
|
|
28
|
+
|
|
29
|
+
**场景:用户想查看已有的 X 账号**
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
x_account_list
|
|
33
|
+
→ 展示账号列表(account_id, handle, display_name)
|
|
34
|
+
→ 用户选择一个账号
|
|
35
|
+
x_account_detail { account_id }
|
|
36
|
+
→ 返回完整配置(audiences, pillars, kols, tweetStyle 等)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**场景:用户不理解某个字段的含义**
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
x_get_field_info
|
|
43
|
+
→ 返回所有字段的中英文说明和示例
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 3. 受众管理
|
|
49
|
+
|
|
50
|
+
### 3.1 查看受众
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
x_audience_list { account_id }
|
|
54
|
+
→ 默认返回第一页 20 条
|
|
55
|
+
→ 支持筛选:keyword, can_dm, bot_score, interest_tags, activity_min/max
|
|
56
|
+
→ 翻页:page=2, page_size=50
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 3.2 导入受众
|
|
60
|
+
|
|
61
|
+
**方式一:从 KOL 关注列表导入**
|
|
62
|
+
```
|
|
63
|
+
x_audience_import_url { account_id, x_url: "https://x.com/username" }
|
|
64
|
+
→ 返回导入结果 + has_more + next_cursor
|
|
65
|
+
→ 如果 has_more=true:
|
|
66
|
+
x_audience_import_url { account_id, x_url, cursor: "下一页游标" }
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**方式二:从推文互动用户导入**
|
|
70
|
+
```
|
|
71
|
+
x_audience_interactive_users { account_id, tweet_url_or_id }
|
|
72
|
+
→ 返回 total, saved, updated, failed
|
|
73
|
+
⚠️ 依赖 RapidAPI,可能返回 total=0
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**方式三:关键词搜索导入**
|
|
77
|
+
```
|
|
78
|
+
x_audience_search_keyword { account_id, keyword: "AI agent" }
|
|
79
|
+
→ 返回 total, saved, updated, failed
|
|
80
|
+
⚠️ 严格频率限制,间隔 > 30s,否则 code 5006
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### 3.3 分组管理
|
|
84
|
+
|
|
85
|
+
**创建动态分组(基于条件自动匹配):**
|
|
86
|
+
```
|
|
87
|
+
x_audience_group_create {
|
|
88
|
+
name: "高活跃AI兴趣组",
|
|
89
|
+
filter_conditions: {
|
|
90
|
+
account_id: 255,
|
|
91
|
+
interest_tags: "AI",
|
|
92
|
+
activity_min: 50
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**创建静态分组(指定用户列表):**
|
|
98
|
+
```
|
|
99
|
+
x_audience_group_create {
|
|
100
|
+
name: "VIP用户",
|
|
101
|
+
user_ids: [100, 101, 102]
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**查看/更新/删除:**
|
|
106
|
+
```
|
|
107
|
+
x_audience_group_list
|
|
108
|
+
x_audience_group_detail { group_id }
|
|
109
|
+
x_audience_group_update { group_id, name: "新名称" }
|
|
110
|
+
x_audience_group_delete { group_id } ⚠️ 不可逆
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### 3.4 兴趣标签
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
x_audience_interest_tags { account_id }
|
|
117
|
+
→ 标签统计列表
|
|
118
|
+
|
|
119
|
+
x_audience_interest_tags_add { account_id, following_id, tags: ["AI", "Creator"] }
|
|
120
|
+
→ 添加标签
|
|
121
|
+
|
|
122
|
+
x_audience_interest_tags_remove { account_id, following_id, tag_name: "Creator" }
|
|
123
|
+
→ 移除单个标签
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### 3.5 营销活动
|
|
127
|
+
|
|
128
|
+
**添加受众到活动:**
|
|
129
|
+
```
|
|
130
|
+
x_audience_add_to_activity {
|
|
131
|
+
activity_id: 10,
|
|
132
|
+
account_id: 255,
|
|
133
|
+
user_ids: [100, 101, 102],
|
|
134
|
+
send_type: "manual"
|
|
135
|
+
}
|
|
136
|
+
→ 异步操作
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**轮询进度:**
|
|
140
|
+
```
|
|
141
|
+
x_audience_activity_progress { activity_id: 10, account_id: 255 }
|
|
142
|
+
→ total, completed, failed, in_progress
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 4. 典型对话流程示例
|
|
148
|
+
|
|
149
|
+
### 示例 A:「帮我看看我有哪些 X 账号」
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
1. x_verify_connection → 验证通过
|
|
153
|
+
2. x_account_list → 返回 3 个账号
|
|
154
|
+
3. 展示列表,询问是否需要查看某个账号详情
|
|
155
|
+
4. x_account_detail { account_id: 255 } → 展示完整配置
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### 示例 B:「从 @elonmusk 的关注列表导入受众」
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
1. x_verify_connection → 验证通过
|
|
162
|
+
2. x_audience_import_url { account_id: 255, x_url: "https://x.com/elonmusk" }
|
|
163
|
+
3. 如果 has_more=true,询问是否继续导入
|
|
164
|
+
4. x_audience_list { account_id: 255 } → 确认受众已更新
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### 示例 C:「给活跃度高的 AI 受众创建一个分组」
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
1. x_verify_connection → 验证通过
|
|
171
|
+
2. x_audience_group_create {
|
|
172
|
+
name: "高活跃AI粉丝",
|
|
173
|
+
filter_conditions: {
|
|
174
|
+
account_id: 255,
|
|
175
|
+
interest_tags: "AI",
|
|
176
|
+
activity_min: 70
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
3. x_audience_group_detail { group_id } → 确认匹配数量
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## 5. 注意事项
|
|
185
|
+
|
|
186
|
+
| 事项 | 说明 |
|
|
187
|
+
|------|------|
|
|
188
|
+
| API Key | 所有请求需携带有效 x-api-key |
|
|
189
|
+
| 超时 | 普通操作 30s,导入/搜索/活动操作 60s |
|
|
190
|
+
| 频率限制 | search-by-keyword 需间隔 30s+ |
|
|
191
|
+
| 分页 | audience_list 用 page/page_size,import_url 用 cursor |
|
|
192
|
+
| 不可逆 | group_delete 删除后无法恢复 |
|
|
193
|
+
| 外部依赖 | interactive_users 依赖 RapidAPI |
|