shumengya
This commit is contained in:
42
index.html
Normal file
42
index.html
Normal file
@@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Favicon 代理 API</title>
|
||||
<style>
|
||||
* { box-sizing: border-box; }
|
||||
body { font-family: system-ui, sans-serif; max-width: 640px; margin: 0 auto; padding: 1.5rem; line-height: 1.6; }
|
||||
h1 { font-size: 1.5rem; }
|
||||
code { background: #f0f0f0; padding: .2em .4em; border-radius: 4px; }
|
||||
pre { background: #f5f5f5; padding: 1rem; overflow: auto; border-radius: 6px; }
|
||||
.example { margin: 1rem 0; }
|
||||
.example img { vertical-align: middle; margin-right: .5rem; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Favicon 代理 API</h1>
|
||||
<p>通过 HTTP API 代理获取任意网站的 favicon,使用 <strong>Google</strong>、<strong>DuckDuckGo</strong> 与<strong>直连目标站</strong>三路竞速,谁先返回就用谁,适合在国内无法直连的站点。(Bing 无公开 favicon API,故用 DuckDuckGo 作为第二源。)</p>
|
||||
|
||||
<h2>用法</h2>
|
||||
<p>GET 请求,支持参数:</p>
|
||||
<ul>
|
||||
<li><code>url</code> 或 <code>domain</code> 或 <code>u</code>:目标网站地址或域名(必填)</li>
|
||||
<li><code>size</code>:图标尺寸,16–256,默认 128(仅对 Google 源有效)</li>
|
||||
</ul>
|
||||
|
||||
<h2>示例</h2>
|
||||
<div class="example">
|
||||
<code>/api/favicon?url=https://twitter.com</code><br>
|
||||
<img src="/api/favicon?url=https://twitter.com" alt="twitter" width="32" height="32">
|
||||
</div>
|
||||
<div class="example">
|
||||
<code>/api/favicon?domain=github.com&size=64</code><br>
|
||||
<img src="/api/favicon?domain=github.com&size=64" alt="github" width="64" height="64">
|
||||
</div>
|
||||
|
||||
<h2>直接调用</h2>
|
||||
<pre>GET https://你的 Pages 域名/api/favicon?url=https://example.com</pre>
|
||||
<p>返回为图片二进制(或 400/502 JSON 错误)。</p>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user