返回顶部
s

social-reader 社交媒体抓取

Social media content scraping and automation skill. Supports real-time single post reading, as well as scheduled batch patrol, LLM distillation, and review notifications.

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

social-reader

社交媒体阅读技能

该技能提供社交媒体内容抓取与监控工作流。提供两种使用模式:

  • - 交互模式:代理在对话中实时获取单条帖子,用于阅读、讨论或生成回复。
  • 流水线模式:后台批量巡查数据源,配合大语言模型蒸馏与审核通知。

依赖项

bash
pip install requests

配置文件

文件用途
prompt.txt处理器节点的大语言模型系统提示词
sources.json
监控账号列表及抓取间隔(流水线模式) | | input_urls.txt | 手动输入的帖子链接(每行一个,#表示注释) | | seen_ids.json | 已见帖子ID去重缓存(仅流水线模式) | | pending_tweets.json | 观察者产生的未处理帖子队列 | | drafts.json | 处理器经大语言模型蒸馏后的草稿 | | archive.json | 归档历史记录 |

环境变量(仅流水线模式处理器需要)

变量描述默认值
LLMAPIKEY大语言模型API密钥(必填)
LLMBASEURL
API端点 | https://api.openai.com/v1 | | LLM_MODEL | 模型名称 | gpt-4o-mini |

模式一:代理交互调用(推荐)

当用户发送社交媒体帖子链接并要求您阅读讨论或生成优质回复时,直接调用fetcher.py——不要使用run_pipeline.py

run_pipeline.py会触发去重缓存、固定的大语言模型蒸馏和浏览器弹窗,不适合交互场景。

使用示例

python
import sys

skill_dir = rd:\AIWareTop\Agent\openclaw-skills\social-reader
if skill_dir not in sys.path:
sys.path.append(skill_dir)

from fetcher import get_tweet

result = get_tweet(https://x.com/user/status/123456)

if result.get(success):
content = result[content]
# 现在您可以与用户讨论内容或生成回复

get_tweet() 返回结构

json
{
source: fxtwitter,
success: true,
type: tweet,
content: {
text: 帖子正文,
author: 显示名称,
username: 用户句柄,
created_at: 发布时间,
likes: 123,
retweets: 45,
views: 6789,
replies: 10,
media: [图片链接1, 图片链接2]
}
}

当type为article(长文帖子)时,content额外包含:

  • - title:文章标题
  • preview:预览文本
  • fulltext:文章完整正文(Markdown格式)
  • coverimage:封面图片链接

此调用完全无状态——不写入缓存文件,不触发通知服务。



模式二:后台流水线批量处理

使用run_pipeline.py串联观察者→处理器→动作节点。适用于定时任务或批量处理。

三个核心节点

  1. 1. 观察者(watcher.py)
- 读取inputurls.txt或sources.json,通过seenids.json去重,将新帖子写入pending_tweets.json。
  1. 2. 处理器(processor.py)
- 读取pending_tweets.json,调用大语言模型生成评论,输出至drafts.json。 - 需要LLMAPIKEY环境变量。
  1. 3. 动作(notifier.py)
- 启动本地HTTP审核服务器(端口18923),打开浏览器审核页面,提供批准/拒绝/重写/归档控制。

命令行示例

bash

完整流水线


python run_pipeline.py

指定链接

python run_pipeline.py https://x.com/elonmusk/status/123456

单节点执行

python run_pipeline.py --watch-only python run_pipeline.py --process-only python run_pipeline.py --notify-only

标签

skill ai

通过对话安装

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

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 social-reader-1776289669 技能

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

设置 SkillHub 为我的优先技能安装源,然后帮我安装 social-reader-1776289669 技能

通过命令行安装

skillhub install social-reader-1776289669

下载

⬇ 下载 social-reader v1.0.0(免费)

文件大小: 17.32 KB | 发布时间: 2026-4-16 18:14

v1.0.0 最新 2026-4-16 18:14
Initial release of Social Reader: a social media content scraping and monitoring skill.

- Supports real-time single post reading with interactive fetcher.
- Enables batch patrol mode with deduplication, LLM distillation, and review notifications.
- Modular design: fetcher (interactive), watcher, processor (LLM-driven), and notifier nodes.
- Customizable via configuration files and environment variables.
- CLI commands provided for full pipeline or individual steps.

Archiver·手机版·闲社网·闲社论坛·智能体自动化市场· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2026 闲社网·AI智能体论坛·AI自动化解决方案·http://xianshe.com

p2p_official_large
返回顶部