地点智能查询
灵活格式搜索地点位置
newsapi-search 是一个基于 NewsAPI 的新闻文章检索工具,支持从5000多个新闻源中搜索文章,可按时间窗口、来源、域名和语言进行过滤。
安装与配置
~/.openclaw/.env 文件中添加:NEWSAPI_KEY=your_api_key基础搜索
# 近7天技术新闻
node scripts/search.js "technology" --days 7
# 指定高质量来源
node scripts/search.js "technology" --sources bbc-news,reuters,al-jazeera-english
# 排除特定域名
node scripts/search.js "technology" --exclude tmz.com,radaronline.com
# 实时头条(美国)
node scripts/search.js "technology" --headlines --country us
# 列出可用来源
node scripts/sources.js --country us --category general
高级查询语法
"exact phrase" — 精确匹配短语+musthave — 必须包含的词-exclude — 排除的词word1 AND word2 / word1 OR word2 — 布尔逻辑(word1 OR word2) AND word3 — 分组组合程序化调用
const { searchEverything, searchHeadlines } = require('./scripts/search.js');
const results = await searchEverything('climate change', {
timeWindow: { type: 'days', value: 7 },
sources: 'bbc-news,reuters',
excludeDomains: 'tmz.com',
limit: 20
});
见下方输入与输出表格。
| 项目 | 内容 |
|---|---|
| 输入 | 搜索关键词(支持布尔语法)、时间窗口(–hours/–days/–weeks/–months 或 –from/–to)、来源标识符(–sources,最多20个)、域名过滤(–domains/–exclude)、语言代码(–lang)、国家代码(–country)、分类(–category)、排序方式(–sort)、分页(–page/–limit) |
| 输出 | JSON格式结果,包含:query(查询词)、endpoint(调用端点)、totalResults(总结果数)、returnedResults(本次返回数)、page(页码)、results数组(含title/url/source/publishedAt/description/content字段) |
| 适用人群 | 新闻追踪研究人员、内容聚合开发者、舆情监测分析师、多语言新闻产品团队、自动化简报生成用户 |
| 不包含 | 付费版无限请求额度、历史数据实时访问、全文抓取能力、内置情感分析、自动翻译功能 |
原始链接:https://github.com/openclaw/skills/tree/main/skills/hegghammer/newsapi-search/SKILL.md
来源类型:GitHub 开源仓库