{"id":30309612,"url":"https://github.com/eallion/api","last_synced_at":"2026-02-11T15:32:06.611Z","repository":{"id":307844999,"uuid":"1030842252","full_name":"eallion/api","owner":"eallion","description":"API on EdgeOne","archived":false,"fork":false,"pushed_at":"2025-09-10T17:23:31.000Z","size":97,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-10T17:53:48.299Z","etag":null,"topics":["api","cloud","edgeone","functions","pages","tencent"],"latest_commit_sha":null,"homepage":"https://api.eallion.com","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eallion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-02T12:49:59.000Z","updated_at":"2025-09-10T17:23:34.000Z","dependencies_parsed_at":"2025-08-02T16:11:47.263Z","dependency_job_id":"9813b8dd-587f-4d63-a914-da0b9e6fc1d9","html_url":"https://github.com/eallion/api","commit_stats":null,"previous_names":["eallion/api"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/eallion/api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eallion%2Fapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eallion%2Fapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eallion%2Fapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eallion%2Fapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eallion","download_url":"https://codeload.github.com/eallion/api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eallion%2Fapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29336868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T14:34:07.188Z","status":"ssl_error","status_checked_at":"2026-02-11T14:34:06.809Z","response_time":97,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","cloud","edgeone","functions","pages","tencent"],"created_at":"2025-08-17T13:46:53.494Z","updated_at":"2026-02-11T15:32:06.606Z","avatar_url":"https://github.com/eallion.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API Tencent EdgeOne Pages\n\n- `api.eallion.com`\n\n## 功能说明\n\n本项目基于 Tencent EdgeOne Pages Functions 实现，提供了一系列 API 接口，用于代理访问第三方服务。\n每个功能都按照 [EdgeOne 官方文档](https://edgeone.cloud.tencent.com/pages/document/162936866445025280) 的要求实现，\n采用单独的函数文件结构，所有代码均为 JavaScript。\n\n## API 接口列表\n\n### /bing\n\n代理访问必应每日壁纸数据。\n\n### /favicon\n\n代理访问 `https://t3.gstatic.cn/faviconV2` 获取网站图标。\n\n### /geo\n\n返回客户端的地理位置。\n\n### /gravatar\n\n代理访问 `https://www.libravatar.org/avatar` 获取 Gravatar 头像。\n\n### /gts\n\n短链接服务，支持以下功能：\n\n1. **基本功能**：\n   - 通过 `/gts/{key}` 访问短链接，自动重定向到目标 URL\n   - 示例: `GET /gts/123` → 重定向到预设的 URL\n\n2. **管理接口**：\n   - 设置键值对（通过 URL 参数）：\n\n     ```\n     POST /gts/admin?key=test\u0026value=valuetest\u0026token=your_api_token\n     ```\n\n   - 设置键值对（通过请求体，推荐）：\n\n     ```\n     curl -X POST \\\n       https://your-domain.com/gts/admin \\\n       -H \"Authorization: Bearer your_api_token\" \\\n       -H \"Content-Type: application/json\" \\\n       -d '{\"key\": \"test-key\", \"value\": \"test-value\"}'\n     ```\n\n   - 删除键值对：\n\n     ```\n     curl -X DELETE \\\n       \"https://your-domain.com/gts/admin?key=test-key\" \\\n       -H \"Authorization: Bearer your_api_token\"\n     ```\n\n3. **环境变量配置**：\n   - `API_TOKEN`: 用于认证的管理员令牌\n   - `API_KV`: KV 存储绑定名称 (默认为 goto_gts)\n\n### /ip\n\n返回客户端的公网 IP 地址。\n\n### /lol\n\n代理访问英雄数据并将 `hero` 字段转换为 Directus 自动完成可用的数组格式。\n\n示例：`GET /lol/163.js` → 代理到 `https://game.gtimg.cn/images/lol/act/img/js/hero/163.js`，返回 JSON，`hero` 为数组，示例：\n\n```json\n{\n  \"file\": \"https://game.gtimg.cn/images/lol/act/img/js/hero/163.js\",\n  \"hero\": [\n    {\n      \"id\": \"163\",\n      \"title\": \"岩雀\",\n      \"heroId\": \"163\",\n      \"name\": \"岩雀\",\n      \"alias\": \"Taliyah\",\n      ...\n    }\n  ]\n}\n```\n\n### /mastodon\n\n代理访问 `https://e5n.cc/api/v1/accounts/111136231674527355/statuses` 获取 Mastodon 状态。\n\n### /memos\n\n代理访问 `https://memos.eallion.com/api/v1/memos` 获取 Memos 数据。\n\n### /og\n\n代理访问 `https://og.eallion.com/api/og` 获取 OG 图片。\n\n### /translate\n\n使用彩云翻译 API 实现中文到英文的实时翻译。\n\n请求示例：\n\n```\nGET /translate?slug=标题示例\n```\n\n响应示例：\n\n```json\n{\n  \"status\": \"success\",\n  \"slug\": \"标题示例\",\n  \"translated\": \"title-example\",\n  \"timestamp\": \"2023-04-01T12:00:00.000Z\"\n}\n```\n\n环境变量配置：\n\n- `CAIYUN_TOKEN`: 彩云翻译 API Token\n\n## 部署要求\n\n1. 在腾讯云 EdgeOne Pages 中配置以下环境变量：\n   - `API_TOKEN`: 设置您的管理令牌\n   - `CAIYUN_TOKEN`: 彩云翻译 API Token\n   - 绑定 KV 存储并命名为 `goto_gts` (或修改代码使用其他名称)\n\n2. 确保 edgeone.json 配置正确，包含以下路由：\n\n   ```json\n   \"routes\": [\n     {\n       \"pattern\": \"/gts/*\",\n       \"script\": \"functions/gts/[[path]].js\",\n       \"methods\": [\"GET\", \"POST\", \"PUT\", \"DELETE\", \"HEAD\"]\n     },\n     {\n       \"pattern\": \"/translate\",\n       \"script\": \"functions/translate/index.js\",\n       \"methods\": [\"GET\"]\n     }\n   ]\n   ```\n\n3. 部署后测试：\n   - 测试短链接功能: `GET /gts/test`\n   - 测试管理接口:\n\n     ```bash\n     curl -X POST \"http://your-domain/gts/admin?key=test\u0026value=example\u0026token=your_token\"\n     curl -X DELETE \"http://your-domain/gts/admin?key=test\u0026token=your_token\"\n     ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feallion%2Fapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feallion%2Fapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feallion%2Fapi/lists"}