[feat] 无 Key 搜索层增加 You.com 免费搜索接口 / Add You.com's free no-key search to the no-key search layer

Open
#1,289 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
20/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
search

Research direction

The no-key search fallback and the third-party provider list are the two places this touches, and the issue names service.ts as the home of the shared fetchJson and normalizeSources helpers. Read the no-key layer's existing Bing and DuckDuckGo parsing first to see where a new first step would sit. Do not start coding until the maintainer confirms whether they want option 1, option 2, or both, since the issue itself asks for that decision.

Written by the indexing model from the issue text.

Description

描述你的建议:

先说明:我在 You.com 工作,所以请酌情参考这个建议。

没有配置任何搜索 Key 时,联网搜索会走无 Key 搜索层,也就是解析 Bing 和 DuckDuckGo 的网页结果。这种方式依赖页面结构,页面改版后可能失效。

建议:

  1. 在无 Key 搜索层的最前面加一步 You.com 免费接口 https://api.you.com/v1/agents/search:无需 Key、无需注册,每天 100 次。出错或额度用完时,继续走现有的 Bing / DuckDuckGo 解析。
  2. 在第三方搜索服务列表里加一个可选的 you,填写 Key 后使用正式 Search API(https://ydc-index.io/v1/search),额度更高。

第 1 条会改变无 Key 用户的搜索请求先发到哪里(先 You.com,再 Bing),所以要不要做由你决定。

实现上复用 service.ts 里的 fetchJson 和 normalizeSources,改动很小。请求 You.com 时会带上 User-Agent: youdotcom-integration/codexu-note-gen,方便我们统计来源,只用于 You.com 的请求。

想先确认方向:1 和 2 都要,还是只要其中一个?确认后我再提 PR。如果不合适,直接说,我会关闭这个 issue。


I work at You.com, so treat the recommendation accordingly.

When no search key is configured, web search falls back to the no-key layer, which parses Bing and DuckDuckGo result pages. That depends on page markup and can stop working when a page changes.

Proposal:

  1. Add You.com's free endpoint (https://api.you.com/v1/agents/search) as the first step of the no-key layer: no key, no account, 100 searches a day. On an error or when the quota runs out, it falls through to the existing Bing and DuckDuckGo parsing.
  2. Add an optional you entry to the third-party provider list that uses the keyed Search API (https://ydc-index.io/v1/search) when a key is set.

Point 1 changes where no-key searches go first (You.com, then Bing), so that's your call.

It reuses fetchJson and normalizeSources in service.ts, so the change is small. For transparency: requests to You.com would send User-Agent: youdotcom-integration/codexu-note-gen, only on You.com requests.

Do you want both, or just one? I'll open the PR once you pick. If it doesn't fit, say so and I'll close this without fuss.

Dominant language
TypeScript
Stars
12.9k
Forks
975
Avg merge
20h 27m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from codexu/note-gen

All issues in codexu/note-gen

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.