Files
胡大头 edfa5f0da3 feat: add DuckDuckGo, Brave, and Yahoo web search adapters (#1546)
* feat: add DuckDuckGo, Brave, and Yahoo web search adapters

Add three new search engine adapters with browser-based DOM extraction:

- duckduckgo/search: Search DuckDuckGo via html.duckduckgo.com
  Supports region, time filters, and XHR-based pagination (--offset)
- duckduckgo/suggest: Search suggestion autocomplete (no browser needed)
- brave/search: Search Brave Search via search.brave.com
  Supports GET-based pagination (--offset)
- yahoo/search: Search Yahoo (Bing-powered) via search.yahoo.com
  Supports GET-based pagination (--page)

All search adapters use Strategy.PUBLIC with browser:true, navigating
the target site and extracting results via page.evaluate() DOM queries.
Includes full test coverage (16 tests).

* fix: use clampInt from shared utils and add adapter docs

- Replace Math.max/Math.min patterns with clampInt() from _shared/common.js
  to pass the typed-error-lint gate (4 silent-clamp violations resolved)
- Add adapter documentation for duckduckgo, brave, and yahoo to fix
  the doc-coverage CI check
- Regenerate cli-manifest.json and typed-error-lint-baseline.json

* fix: avoid silent-column-drop overlap in brave/yahoo extractors

Change buildExtractorJs to return arrays instead of objects whose keys
matched columns. This prevents silent-column-drop audit false positives
as per opencli-adapter-author conventions.

* fix(search): tighten browser search adapters

* chore(search): drop baseline churn

* fix(duckduckgo): execute search extractor safely

* fix(yahoo): reject unsafe redirect targets

---------

Co-authored-by: huzekang <huzekang@opencode.ai>
Co-authored-by: jackwener <jakevingoo@gmail.com>
2026-05-14 17:54:34 +08:00

1.6 KiB

Yahoo Search

Mode: 🌐 Public · Domain: search.yahoo.com

Commands

Command Description
opencli yahoo search <keyword> Search Yahoo (powered by Bing) and extract results from the page

What works today

  • Uses browser mode to search search.yahoo.com and extract ranked results via DOM queries.
  • Supports --page for pagination. Yahoo returns approximately 7 results per page.
  • Results include rank, title, URL, and snippet.
  • --limit must be between 1 and 7; --page must be a positive integer.

Current limitations

  • Requires browser mode.
  • Yahoo returns fewer results per page (7) compared to other engines.
  • Page 2+ results may include lower-quality or less relevant matches.
  • Yahoo wraps URLs in a RU=.../RK= redirect structure; the adapter automatically decodes them.

Usage Examples

# Basic search
opencli yahoo search "machine learning"

# Limit results
opencli yahoo search "machine learning" --limit 5

# Pagination (second page)
opencli yahoo search "machine learning" --page 2

# JSON output
opencli yahoo search "machine learning" -f json

Prerequisites

Notes

  • Yahoo Search is powered by Bing. Results are rendered server-side in the initial HTML.
  • Yahoo uses RU= redirect URLs to wrap search results; the adapter extracts the real URLs automatically.
  • Region/language filtering is not currently exposed as a parameter. Results depend on the browser session's locale.