trigger_crawl
Manually trigger a crawl for specified platforms to aggregate trending news. Optionally save results locally and include URLs for detailed analysis.
Instructions
手动触发一次爬取任务(可选持久化)
Args: platforms: 指定平台ID列表,如 ['zhihu', 'weibo', 'douyin'] - 不指定时:使用 config.yaml 中配置的所有平台 - 支持的平台来自 config/config.yaml 的 platforms 配置 - 每个平台都有对应的name字段(如"知乎"、"微博"),方便AI识别 - 注意:失败的平台会在返回结果的 failed_platforms 字段中列出 save_to_local: 是否保存到本地 output 目录,默认 False include_url: 是否包含URL链接,默认False(节省token)
Returns: JSON格式的任务状态信息,包含: - platforms: 成功爬取的平台列表 - failed_platforms: 失败的平台列表(如有) - total_news: 爬取的新闻总数 - data: 新闻数据
Examples: - 临时爬取: trigger_crawl(platforms=['zhihu']) - 爬取并保存: trigger_crawl(platforms=['weibo'], save_to_local=True) - 使用默认平台: trigger_crawl() # 爬取config.yaml中配置的所有平台
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| platforms | No | ||
| save_to_local | No | ||
| include_url | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |