基于 Deno 开发的趋势发现和内容发布系统,支持多源数据采集、智能总结和自动发布到微信公众号。
🌰 示例公众号:AISPACE科技空间
点击链接加入群聊【AI-Trend-Publish】:https://qm.qq.com/q/EsiP8ZlEFa
即刻关注,体验 AI 智能创作的内容~
- 运行环境: Deno v2.0.0 或更高版本
- 开发语言: TypeScript
- 操作系统: Windows/Linux/MacOS
Windows (PowerShell):
irm https://deno.land/install.ps1 | iex
MacOS/Linux:
curl -fsSL https://deno.land/install.sh | sh
git clone https://github.com/OpenAISpace/ai-trend-publish
cd ai-trend-publish
cp .env.example .env
# 编辑 .env 文件配置必要的环境变量
# Key environment variables include API keys for various AI services.
# For Jina AI functionalities (scraping, search, embeddings, reranking),
# ensure JINA_API_KEY is set. See the .env.example file and the
# Jina Integration Guide for more details.
# 开发模式(支持热重载)
deno task start
# 测试运行
deno task test
# 编译Windows版本
deno task build:win
# 编译Mac版本
deno task build:mac-x64 # Intel芯片
deno task build:mac-arm64 # M系列芯片
# 编译Linux版本
deno task build:linux-x64 # x64架构
deno task build:linux-arm64 # ARM架构
# 编译所有平台版本
deno task build:all
-
🤖 多源数据采集
- Twitter/X 内容抓取
- 网站内容抓取 (基于 FireCrawl)
- 支持自定义数据源配置
- Advanced scraping and search via Jina AI
-
🧠 AI 智能处理
- 使用 DeepseekAI Together 千问 万象 讯飞 进行内容总结
- 关键信息提取
- 智能标题生成
- Text embeddings and reranking via Jina AI
-
📢 自动发布
- 微信公众号文章发布
- 自定义文章模板
- 定时发布任务
-
📱 通知系统
- Bark 通知集成
-
钉钉通知集成
-
飞书通知集成
- 任务执行状态通知
- 错误告警
TrendPublish 提供了多种精美的文章模板。查看 模板展示页面 了解更多详情。
- 微信公众号文章发布
- 大模型每周排行榜
- 热门AI相关仓库推荐
- 添加通义千问(Qwen)支持
- 支持多模型配置(如 DEEPSEEK_MODEL="deepseek-chat|deepseek-reasoner")
- 支持指定特定模型(如 AI_CONTENT_RANKER_LLM_PROVIDER="DEEPSEEK:deepseek-reasoner")
- 热门AI相关论文推荐
- 热门AI相关工具推荐
- FireCrawl 自动注册免费续期
- 内容插入相关图片
- 内容去重
- 降低AI率
- 文章图片优化
- ...
- 提供exe可视化界面
- 运行环境: Deno + TypeScript
- AI 服务: DeepseekAI Together 千问 万象 讯飞 Jina AI (see Integration Guide)
- 数据源:
- Twitter/X API
- FireCrawl
- Jina AI (for scraping and search, see Integration Guide)
- 模板引擎: EJS
- 开发工具:
- Deno
- TypeScript
- Deno (v2+)
- TypeScript
- 克隆项目
git clone https://github.com/OpenAISpace/ai-trend-publish
- 配置环境变量
cp .env.example .env
# 编辑 .env 文件配置必要的环境变量
# Key environment variables include API keys for various AI services.
# For Jina AI functionalities (scraping, search, embeddings, reranking),
# ensure JINA_API_KEY is set. See the .env.example file and the
# Jina Integration Guide (docs/jina_integration_guide.md) for more details.
在 .env
文件中配置必要的环境变量:
(Refer to .env.example
for a comprehensive list of environment variables. For details on Jina AI specific setup, see the Jina Integration Guide).
在使用微信公众号相关功能前,请先将本机IP添加到公众号后台的IP白名单中。
- 查看本机IP: IP查询工具
- 登录微信公众号后台,添加IP白名单
- 启动项目
# 测试模式
deno task test
# 运行
deno start start
详细运行时间见 src\controllers\cron.ts
- 在服务器上安装 Deno
Windows:
irm https://deno.land/install.ps1 | iex
Linux/MacOS:
curl -fsSL https://deno.land/install.sh | sh
- 克隆项目
git clone https://github.com/OpenAISpace/ai-trend-publish.git
cd ai-trend-publish
- 配置环境变量
cp .env.example .env
# 编辑 .env 文件配置必要的环境变量
- 启动服务
# 开发模式(支持热重载)
deno task start
# 测试模式运行
deno task test
# 使用PM2进行进程管理(推荐)
npm install -g pm2
pm2 start --interpreter="deno" --interpreter-args="run --allow-all" src/main.ts
- 设置开机自启(可选)
# 使用PM2设置开机自启
pm2 startup
pm2 save
- 拉取代码
git clone https://github.com/OpenAISpace/ai-trend-publish.git
- 构建 Docker 镜像:
# 构建镜像
docker build -t ai-trend-publish .
- 运行容器:
# 方式1:通过环境变量文件运行
docker run -d --env-file .env --name ai-trend-publish-container ai-trend-publish
# 方式2:直接指定环境变量运行
docker run -d \
-e XXXX=XXXX \
...其他环境变量... \
--name ai-trend-publish-container \
ai-trend-publish
项目已配置 GitHub Actions 自动部署流程:
- 推送代码到 main 分支会自动触发部署
- 也可以在 GitHub Actions 页面手动触发部署
- 确保在 GitHub Secrets 中配置以下环境变量:
SERVER_HOST
: 服务器地址SERVER_USER
: 服务器用户名SSH_PRIVATE_KEY
: SSH 私钥- 其他必要的环境变量(参考 .env.example)
本项目支持自定义模板开发,主要包含以下几个部分:
查看 src/modules/render/interfaces
目录下的类型定义文件,了解各个渲染模块需要的数据结构
在 src/templates
目录下按照对应模块开发 EJS 模板
在对应的渲染器类中注册新模板,如 WeixinArticleTemplateRenderer
:
npx ts-node -r tsconfig-paths/register src\modules\render\test\test.weixin.template.ts
- Fork 本仓库
- 创建特性分支 (
git checkout -b feature/amazing-feature
) - 提交更改 (
git commit -m 'Add some amazing feature'
) - 推送到分支 (
git push origin feature/amazing-feature
) - 提交 Pull Request
感谢以下贡献者对项目的支持:
本项目采用 MIT 许可证 - 详见 LICENSE 文件
提供了基于 JSON-RPC 2.0 协议的 API,支持手动触发工作流。
- 端点:
/api/workflow
- 支持方法:
triggerWorkflow
- 详细文档: JSON-RPC API 文档