๐ฆ ClawHub
Ddg Search Fetch
by @mengbin92
Search the web and fetch URL content using DuckDuckGo. Use when the user wants to search for information online without requiring API keys or paid services....
TERMINAL
clawhub install ddg-search-fetch๐ About This Skill
name: duckduckgo-search description: Search the web and fetch URL content using DuckDuckGo. Use when the user wants to search for information online without requiring API keys or paid services. Supports text search with results including title URL and snippet. Also supports URL fetching to extract readable content from web pages. Triggers on phrases like "search for" "look up" "find information about" "fetch url" "get page content" or when web_search is unavailable.
DuckDuckGo Search & Fetch
Search the web and fetch URL content using DuckDuckGo (no API key required).
Prerequisites
้่ฆๅฎ่ฃ ไพ่ต:
pip3 install duckduckgo-search
ๅ่ฝ
1. ็ฝ้กตๆ็ดข (ddg_search.py)
python3 scripts/ddg_search.py "your search query" [--max-results 10]
2. ็ฝ้กตๆๅ (ddg_fetch.py)
python3 scripts/ddg_fetch.py "https://example.com" [--timeout 30]
Usage Examples
ๆ็ดข
# Basic search
python3 scripts/ddg_search.py "OpenClaw AI agent"Search with more results
python3 scripts/ddg_search.py "Python best practices" --max-results 15
ๆๅ็ฝ้กต
# Fetch a webpage
python3 scripts/ddg_fetch.py "https://openclaw.ai"With custom timeout
python3 scripts/ddg_fetch.py "https://example.com" --timeout 15Plain text output
python3 scripts/ddg_fetch.py "https://example.com" --format text
Output Format
ๆ็ดข็ปๆ (JSON)
{
"query": "search query",
"count": 10,
"results": [
{
"title": "Result title",
"url": "https://example.com",
"snippet": "Description snippet"
}
]
}
ๆๅ็ปๆ (JSON)
{
"url": "https://example.com",
"title": "Page Title",
"text": "Extracted readable content...",
"description": "Meta description",
"status_code": 200,
"error": null
}
Integration with OpenClaw
Example workflow
# Search
result = exec({
"command": "python3 /path/to/skills/duckduckgo-search/scripts/ddg_search.py query"
})
Parse: json.loads(result.stdout)
Fetch URL
result = exec({
"command": "python3 /path/to/skills/duckduckgo-search/scripts/ddg_fetch.py https://example.com"
})
Parse: json.loads(result.stdout)
โ๏ธ Configuration
้่ฆๅฎ่ฃ ไพ่ต:
pip3 install duckduckgo-search