Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions agent_reach/channels/xiaohongshu.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,26 @@ def check(self, config=None):
errors="replace",
timeout=10,
)
out = r.stdout.lower()
if r.returncode == 0 and '"status": "ok"' in out:
return "ok", "MCP 已连接(阅读、搜索、发帖、评论、点赞)"
# More robust JSON parsing instead of string matching
# Handle different JSON formats and Windows line endings
import json
try:
# Try to parse the JSON output directly
output = r.stdout.strip()
# Handle potential BOM or whitespace
if output.startswith('\ufeff'):
output = output[1:]
data = json.loads(output)
# Check various possible status field names and values
status = data.get('status', '').lower() if isinstance(data, dict) else ''
if r.returncode == 0 and status == 'ok':
return "ok", "MCP 已连接(阅读、搜索、发帖、评论、点赞)"
except (json.JSONDecodeError, ValueError):
# Fallback to string matching for backward compatibility
# Make it case-insensitive and handle Windows-style output
out = r.stdout.lower().replace('\r\n', '\n').replace('\r', '\n')
if r.returncode == 0 and '"status":"ok"' in out.replace(' ', ''):
return "ok", "MCP 已连接(阅读、搜索、发帖、评论、点赞)"
return "warn", "MCP 已配置,但连接异常;请检查 xiaohongshu-mcp 服务状态"
except subprocess.TimeoutExpired:
return "warn", "MCP 已配置,但健康检查超时;请检查 xiaohongshu-mcp 服务状态"
Expand Down
20 changes: 4 additions & 16 deletions agent_reach/skill/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
---
name: agent-reach
description: >
Give your AI agent eyes to see the entire internet. 7500+ GitHub stars.
Search and read 15 platforms: Twitter/X, Reddit, YouTube, GitHub, Bilibili,
XiaoHongShu (小红书), Douyin (抖音), Weibo (微博), WeChat Articles (微信公众号),
LinkedIn, Instagram, V2EX, RSS, Exa web search, and any web page.
Give your AI agent eyes to see the entire internet. Search and read 15 platforms:
Twitter/X, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu, Douyin, Weibo,
WeChat Articles, LinkedIn, Instagram, V2EX, RSS, Exa web search, and any web page.
One command install, zero config for 8 channels, agent-reach doctor for diagnostics.
Use when: (1) user asks to search or read any of these platforms,
(2) user shares a URL from any supported platform,
(3) user asks to search the web, find information online, or research a topic,
(4) user asks to post, comment, or interact on supported platforms,
(5) user asks to configure or set up a platform channel.
Triggers: "搜推特", "搜小红书", "看视频", "搜一下", "上网搜", "帮我查", "全网搜索",
"search twitter", "read tweet", "youtube transcript", "search reddit",
"read this link", "看这个链接", "B站", "bilibili", "抖音视频",
"微信文章", "公众号", "LinkedIn", "GitHub issue", "RSS", "微博",
"V2EX", "v2ex", "节点", "看主题", "技术社区",
"search online", "web search", "find information", "research",
"帮我配", "configure twitter", "configure proxy", "帮我安装".
Use when: user asks to search/read platforms, shares URLs, or needs web research.
metadata:
openclaw:
homepage: https://github.com/Panniantong/Agent-Reach
Expand Down