Skip to content

feat(google): add search, suggest, news, and trends adapters#184

Open
Astro-Han wants to merge 3 commits intojackwener:mainfrom
Astro-Han:worktree-add-google-search
Open

feat(google): add search, suggest, news, and trends adapters#184
Astro-Han wants to merge 3 commits intojackwener:mainfrom
Astro-Han:worktree-add-google-search

Conversation

@Astro-Han
Copy link
Contributor

@Astro-Han Astro-Han commented Mar 20, 2026

Closes #183

Summary

  • search: browser-based DOM extraction from google.com/search, outputs type|title|url|snippet (result/snippet/paa types)
  • suggest: public JSON API via suggestqueries.google.com, no browser needed
  • news: public RSS feed from news.google.com, supports top stories and keyword search
  • trends: public RSS feed from trends.google.com, daily trending searches by region
  • utils.ts: shared RSS parser with attribute/CDATA support

Design decisions

  • search uses PUBLIC strategy with browser: true — public data, browser needed for DOM rendering not auth. Standalone mode confirmed working
  • DOM extraction uses structural approach (#rso > a containing h3) instead of class-based selectors, since Google removed .g containers
  • RSS parser handles <tag attr="..."> and <![CDATA[...]]> with prefix-tag protection

Test plan

  • Unit tests: 7 tests for parseRssItems (plain text, CDATA, namespaced fields, attributes, mixed, missing fields, empty)
  • E2E public: suggest, news (top stories + search), trends — with network skip guards
  • E2E browser: search — with tryBrowserCommand/expectDataOrSkip pattern
  • Manual: tested all 4 commands across multiple queries, languages, regions, and output formats (json/table/csv/yaml/md)
  • Verbose mode (-v) verified
  • npm run typecheck passes
  • npx vitest run src/ — 251 tests pass

@Astro-Han Astro-Han force-pushed the worktree-add-google-search branch from f9220f1 to b71c8e3 Compare March 20, 2026 20:24
Four new commands under `google`:
- search: browser-based DOM extraction from google.com/search
- suggest: public JSON API (suggestqueries.google.com)
- news: public RSS feed (top stories + keyword search)
- trends: public RSS feed (daily trending searches by region)

Shared RSS parser in utils.ts with attribute/CDATA support.
Unit tests for parseRssItems, E2E tests with network skip guards.
Google search results are public data, no login needed. Browser is
required for DOM rendering, not authentication. Standalone mode
confirmed working in testing.
@Astro-Han Astro-Han force-pushed the worktree-add-google-search branch from 6e443e4 to 0ec4a20 Compare March 21, 2026 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add Google adapters (search, suggest, news, trends)

1 participant