返回顶部
w

web-search网络搜索

This skill should be used when users need to search the web for information, find current content, look up news articles, search for images, or find videos. It uses DuckDuckGo's search API to return results in clean, formatted output (text, markdown, or JSON). Use for research, fact-checking, finding recent information, or gathering web resources.

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

web-search

Web搜索

概述

使用DuckDuckGo的API搜索网页,查找网页、新闻文章、图片和视频中的信息。支持多种格式(文本、Markdown、JSON)返回结果,并提供时间范围、地区和安全搜索等过滤选项。

何时使用此技能

当用户请求以下内容时使用此技能:

  • - 搜索信息或资源的网页搜索
  • 查找当前或最近的信息
  • 查找特定主题的新闻文章
  • 按描述或主题搜索图片
  • 查找特定主题的视频
  • 需要当前网络数据的研究
  • 使用网络来源进行事实核查或验证
  • 收集某个主题的URL和资源

前提条件

安装所需的依赖:

bash
pip install duckduckgo-search

该库提供了DuckDuckGo搜索API的简单Python接口,无需API密钥或身份验证。

核心功能

1. 基础网页搜索

搜索网页和信息:

bash
python scripts/search.py <查询词>

示例:
bash
python scripts/search.py python asyncio 教程

以清晰的文本格式返回前10个网页结果,包含标题、URL和描述。

2. 限制结果数量

控制返回的结果数量:

bash
python scripts/search.py <查询词> --max-results

示例:
bash
python scripts/search.py 机器学习框架 --max-results 20

适用于:

  • - 获取更全面的结果(增加限制)
  • 快速查找,结果较少(减少限制)
  • 平衡详细程度与处理时间

3. 时间范围过滤

按时效性过滤结果:

bash
python scripts/search.py <查询词> --time-range

时间范围选项:

  • - d - 过去一天
  • w - 过去一周
  • m - 过去一个月
  • y - 过去一年

示例:
bash
python scripts/search.py 人工智能新闻 --time-range w

适用于:

  • - 查找最新新闻或更新
  • 过滤掉过时内容
  • 追踪最新发展

4. 新闻搜索

专门搜索新闻文章:

bash
python scripts/search.py <查询词> --type news

示例:
bash
python scripts/search.py 气候变化 --type news --time-range w --max-results 15

新闻结果包含:

  • - 文章标题
  • 来源出版物
  • 发布日期
  • URL
  • 文章摘要/描述

5. 图片搜索

搜索图片:

bash
python scripts/search.py <查询词> --type images

示例:
bash
python scripts/search.py 日落山景 --type images --max-results 20

图片过滤选项:

尺寸过滤:
bash
python scripts/search.py 风景照片 --type images --image-size Large

选项:Small、Medium、Large、Wallpaper

颜色过滤:
bash
python scripts/search.py 抽象艺术 --type images --image-color Blue

选项:color、Monochrome、Red、Orange、Yellow、Green、Blue、Purple、Pink、Brown、Black、Gray、Teal、White

类型过滤:
bash
python scripts/search.py 图标 --type images --image-type transparent

选项:photo、clipart、gif、transparent、line

布局过滤:
bash
python scripts/search.py 壁纸 --type images --image-layout Wide

选项:Square、Tall、Wide

图片结果包含:

  • - 图片标题
  • 图片URL(图片直接链接)
  • 缩略图URL
  • 来源网站
  • 尺寸(宽 x 高)

6. 视频搜索

搜索视频:

bash
python scripts/search.py <查询词> --type videos

示例:
bash
python scripts/search.py python教程 --type videos --max-results 15

视频过滤选项:

时长过滤:
bash
python scripts/search.py 烹饪食谱 --type videos --video-duration short

选项:short、medium、long

分辨率过滤:
bash
python scripts/search.py 纪录片 --type videos --video-resolution high

选项:high、standard

视频结果包含:

  • - 视频标题
  • 发布者/频道
  • 时长
  • 发布日期
  • 视频URL
  • 描述

7. 地区特定搜索

按地区搜索结果:

bash
python scripts/search.py <查询词> --region <地区代码>

常用地区代码:

  • - us-en - 美国(英语)
  • uk-en - 英国(英语)
  • ca-en - 加拿大(英语)
  • au-en - 澳大利亚(英语)
  • de-de - 德国(德语)
  • fr-fr - 法国(法语)
  • wt-wt - 全球(默认)

示例:
bash
python scripts/search.py 本地新闻 --region us-en --type news

8. 安全搜索控制

控制安全搜索过滤:

bash
python scripts/search.py <查询词> --safe-search

选项:

  • - on - 严格过滤
  • moderate - 平衡过滤(默认)
  • off - 不过滤

示例:
bash
python scripts/search.py 医疗信息 --safe-search on

9. 输出格式

选择结果的格式:

文本格式(默认):
bash
python scripts/search.py 量子计算

清晰可读的纯文本,带编号结果。

Markdown格式:
bash
python scripts/search.py 量子计算 --format markdown

格式化的Markdown,包含标题、粗体文本和链接。

JSON格式:
bash
python scripts/search.py 量子计算 --format json

结构化的JSON数据,适合程序化处理。

10. 保存结果到文件

将搜索结果保存到文件:

bash
python scripts/search.py <查询词> --output <文件路径>

示例:
bash
python scripts/search.py 人工智能 --output ai_results.txt
python scripts/search.py AI新闻 --type news --format markdown --output ai_news.md
python scripts/search.py AI研究 --format json --output ai_data.json

文件格式由--format标志决定,而非文件扩展名。

输出格式示例

文本格式

  1. 1. 页面标题
URL: https://example.com/page 页面内容的简要描述...
  1. 2. 另一个结果
URL: https://example.com/another 另一个描述...

Markdown格式

markdown

1. 页面标题

URL: https://example.com/page

页面内容的简要描述...

2. 另一个结果

URL: https://example.com/another

另一个描述...

JSON格式

json [ { title: 页面标题, href: https://example.com/page, body: 页面内容的简要描述... }, { title: 另一个结果, href: https://example.com/another, body: 另一个描述... } ]

常见使用模式

主题研究

收集关于某个主题的全面信息:

bash

从网页获取概述


python scripts/search.py 机器学习基础 --max-results 15 --output ml_web.txt

获取最新新闻

python scripts/search.py 机器学习 --type news --time-range m --output ml_news.txt

查找教程视频

python scripts/search.py 机器学习教程 --type videos --max-results 10 --output ml_videos.txt

时事监控

追踪特定主题的新闻:

bash
python scripts/search.py 气候峰会 --type news --time-range d --format markdown --output dailyclimatenews.md

查找视觉资源

按特定条件搜索图片:

bash
python scripts/search.py 数据可视化示例 --type images --image-type photo --image-size Large --max-results 25 --output viz_images.txt

事实核查

使用最新来源验证信息:

bash
python scripts/search.py 需要验证的具体声明 --time-range w --max-results 20

学术研究

查找学术主题的资源:

bash
python scripts/search.py 量子纠缠研究 --time-range y --max-results 30 --output quantum_research.txt

市场研究

收集产品或公司的信息:

bash
python scripts/search.py 电动汽车市场2025 --max-results 20 --format markdown --output ev_market.md
python scripts/search.py EV新闻 --type news --time-range m --output ev_news.txt

实现方法

标签

skill ai

通过对话安装

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

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 web-search-1775917512 技能

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

设置 SkillHub 为我的优先技能安装源,然后帮我安装 web-search-1775917512 技能

通过命令行安装

skillhub install web-search-1775917512

下载

⬇ 下载 web-search v1.0.0(免费)

文件大小: 8.6 KB | 发布时间: 2026-4-12 11:55

v1.0.0 最新 2026-4-12 11:55
web-search 1.0.0

- Initial release of the skill.
- Search the web using DuckDuckGo’s API for web pages, news, images, and videos.
- Supports multiple result formats: plain text, markdown, and JSON.
- Includes rich filtering (time range, region, safe search) and content-type options.
- Image and video searches offer flexible filters (size, color, type, duration, resolution, layout).
- Allows saving results to files for further use.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部