技能标识:xhs-surfer
|
XHS Surfer 作为 OpenClaw Skill 的完整使用指南。
bash
python
from openclaw import Agent
agent = Agent()
response = await agent.run(帮我在小红书上看看Python相关的内容)
python
from xhs_surfer import CommunitySurferSkill
skill = CommunitySurferSkill.create()
result = await skill.run(浏览小红书上关于Python的帖子30分钟)
python
await skill.run(看看小红书上关于健身的内容)
await skill.run(浏览AI相关帖子20分钟)
await skill.run(暂停)
await skill.run(继续)
python
python
| Action | 说明 | 参数 |
|---|---|---|
| login | 登录小红书 | method: qr/cookies, timeout, cookiesfile |
| surf |
| Action | 说明 | 参数 |
|---|---|---|
| search | 搜索新关键词 | keyword |
| skip |
python
skill = CommunitySurferSkill.create(
# 浏览器
headless=False,
proxy=http://127.0.0.1:7890,
# 行为
view_speed=1.0, # 0.5=快, 1.0=正常, 2.0=慢
like_probability=0.4, # 点赞概率
comment_probability=0.2, # 评论概率
follow_probability=0.1, # 关注概率
# 安全
maxlikesper_hour=20,
maxcommentsper_hour=8,
)
python
skill = CommunitySurferSkill(config={
# 浏览器配置
browser: {
headless: False,
slow_mo: 50, # 动作间延迟(ms)
viewport: {width: 1280, height: 720},
proxy: http://127.0.0.1:7890,
timeout: 30000,
},
# 行为配置
behavior: {
view_speed: 1.0, # 浏览速度倍数
minactiondelay: 1.0, # 最小动作间隔(秒)
maxactiondelay: 5.0, # 最大动作间隔(秒)
like_probability: 0.4, # 点赞概率
comment_probability: 0.2, # 评论概率
follow_probability: 0.1, # 关注概率
scroll_probability: 0.8, # 滚动概率
},
# 安全配置
safety: {
maxlikesper_hour: 20,
maxcommentsper_hour: 8,
maxfollowsper_hour: 15,
maxlikesper_day: 150,
maxcommentsper_day: 50,
autostopon_warning: True,
autostopon_captcha: True,
avoidlatenight: True, # 避免深夜操作
},
# 营销配置
marketing: {
enabled: True,
target_keywords: [健身, 减脂],
comment_templates: [写得好!, 学习了!],
},
# LLM 配置
llm: {
provider: qwen,
model: qwen-turbo,
api_key: sk-xxx,
}
})
bash
python
python
import asyncio
from openclaw import Agent
async def main():
agent = Agent()
response = await agent.run(帮我在小红书上找找Python教程)
print(response)
asyncio.run(main())
python
import asyncio
from xhs_surfer import CommunitySurferSkill
async def main():
skill = CommunitySurferSkill.create()
result = await skill.run(浏览小红书上关于AI的内容15分钟)
print(result)
asyncio.run(main())
python
import asyncio
from xhs_surfer import CommunitySurferSkill
async def main():
# 创建带配置的 Skill
skill = CommunitySurferSkill.create(
headless=True,
view_speed=1.5,
like_probability=0.5,
comment_probability=0.3,
)
# 登录
result = await skill.execute({action: login, method: qr})
if not result[success]:
print(登录失败)
return
# 冲浪
result = await skill.execute({
action: surf,
topic: Python编程,
duration_minutes: 30
})
print(f浏览: {result[summary][posts_viewed]})
print(f点赞: {result[summary][likes_given]})
print(f评论: {result[summary][comments_made
以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:
帮我安装 SkillHub 和 xhs-surfer-1776097335 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 xhs-surfer-1776097335 技能
skillhub install xhs-surfer-1776097335
文件大小: 3.55 KB | 发布时间: 2026-4-15 15:03