web-search

安全的网络搜索工具,支持多个搜索引擎

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "web-search" with this command: npx skills add nidhov01/02

AI联网搜索技能

安全的网络搜索工具,支持多个搜索引擎,无需API密钥。

技能描述

提供免费的网络搜索功能,支持DuckDuckGo和Wikipedia等搜索引擎,内置结果缓存机制(24小时),保护用户隐私。

使用场景

  • 用户问:"Python最新版本是什么?" → 搜索并返回结果
  • 用户说:"搜索人工智能的最新进展" → 获取相关资讯
  • 用户问:"什么是量子计算?" → 搜索Wikipedia百科
  • 用户说:"查找Python教程" → 返回搜索结果

工具和依赖

工具列表

  • scripts/web_search.py:核心搜索模块

API密钥

无(使用免费搜索引擎)

外部依赖

  • Python 3.7+
  • duckduckgo-search
  • beautifulsoup4
  • requests

配置说明

环境变量

# 可选:付费搜索引擎API
export SERPER_API_KEY="your-key"  # Serper API
export BRAVE_API_KEY="your-key"   # Brave Search API

数据存储位置

缓存:~/.ai_search_cache.db(24小时有效期)

使用示例

基本用法

from web_search import WebSearchTool

# 创建搜索工具
search = WebSearchTool()

# 综合搜索
results = search.search("Python编程", engines=['duckduckgo', 'wikipedia'])

# 快速搜索(格式化输出)
print(search.quick_search("人工智能"))

场景1:综合搜索

用户:"搜索Python编程教程"

AI:

results = search.search("Python编程", engines=['duckduckgo'])
# 返回前10个结果,包含标题、链接、摘要

场景2:百科查询

用户:"什么是量子计算?"

AI:

results = search.search("量子计算", engines=['wikipedia'])
# 返回Wikipedia摘要

场景3:使用缓存

用户:"再次搜索Python"(短时间内重复搜索)

AI:

# 从缓存返回结果,提高速度
results = search.search("Python")
# 结果来源:缓存

故障排除

问题1:DuckDuckGo搜索失败

现象:搜索无结果或报错

解决

  1. 检查网络连接
  2. DuckDuckGo有请求频率限制,稍后重试
  3. 尝试切换到Wikipedia引擎

问题2:缓存过期

现象:搜索结果较旧

解决

# 清除缓存
rm ~/.ai_search_cache.db

问题3:搜索结果不相关

现象:返回结果与问题不符

解决

  1. 使用更精确的关键词
  2. 尝试不同的搜索引擎
  3. 使用付费API获得更好结果(可选)

注意事项

  1. 请求频率:DuckDuckGo免费API有频率限制
  2. 结果时效:搜索结果仅供参考,请自行验证
  3. 缓存机制:24小时内的重复搜索会返回缓存结果
  4. 隐私保护:搜索缓存存储在本地,不上传云端

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Research

Duckduckgo Search

DuckDuckGo web search for private tracker-free searching. Use when user asks to search the web find information online or perform web-based research without...

Registry SourceRecently Updated
3980Profile unavailable
General

Wechat Mp Writer

WeChat Official Account (公众号) content writer with article formatting, headline optimization, and engagement tips. Use when you need to write WeChat articles,...

Registry SourceRecently Updated
General

OpenClaw EverMemory Installer

Use this skill when installing, upgrading, verifying, or publishing the EverMemory OpenClaw plugin and its companion skill, including local path install, npm...

Registry SourceRecently Updated
General

Ip Advisor

知识产权顾问。专利、版权、商业秘密、注册流程、保护策略。IP advisor for patents, copyrights, trade secrets. 知识产权、专利、版权。

Registry SourceRecently Updated
1950ckchzh