{"id":13529162,"url":"https://github.com/CodeDaraW/douban-box","last_synced_at":"2025-04-01T15:30:36.257Z","repository":{"id":55961192,"uuid":"242480192","full_name":"CodeDaraW/douban-box","owner":"CodeDaraW","description":"📚🎬🎵将豆瓣用户的书影音数据同步到 Gist ！","archived":false,"fork":false,"pushed_at":"2020-12-04T07:49:06.000Z","size":16,"stargazers_count":14,"open_issues_count":0,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T21:05:57.479Z","etag":null,"topics":["douban-box","gist"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CodeDaraW.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-23T08:13:25.000Z","updated_at":"2024-12-22T09:31:19.000Z","dependencies_parsed_at":"2022-08-15T10:20:37.711Z","dependency_job_id":null,"html_url":"https://github.com/CodeDaraW/douban-box","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeDaraW%2Fdouban-box","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeDaraW%2Fdouban-box/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeDaraW%2Fdouban-box/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeDaraW%2Fdouban-box/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodeDaraW","download_url":"https://codeload.github.com/CodeDaraW/douban-box/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246662219,"owners_count":20813708,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["douban-box","gist"],"created_at":"2024-08-01T07:00:33.898Z","updated_at":"2025-04-01T15:30:35.956Z","avatar_url":"https://github.com/CodeDaraW.png","language":"TypeScript","funding_links":[],"categories":["External Services"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"400\" src=\"https://user-images.githubusercontent.com/12277082/75358669-3dc4f480-58ee-11ea-8359-1dff65a7ff1d.png\" /\u003e\n  \u003ch2 align=\"center\"\u003eDouban Box\u003c/h2\u003e\n  \u003cp align=\"center\"\u003e更新豆瓣用户的书影音数据到 Gist ！\u003c/p\u003e\n\u003c/p\u003e\n\n--- \n\n\u003e 📌✨ 更多像这样的 Pinned Gist 项目请访问：https://github.com/matchai/awesome-pinned-gists\n\n## 安装\n``` sh\n$ npm i -g douban-box\n```\n\n## 基本原理\n提供四个环境变量：\n| 变量 | 含义 |\n|---|---|\n| GIST_ID | Gist ID |\n| GITHUB_TOKEN | GitHub Token |\n| DOUBAN_ID | 豆瓣用户 ID |\n| DOUBAN_COOKIE | 豆瓣登录态 Cookie |\n\n执行 CLI 时会读取环境变量，抓取指定用户的主页，更新对应的 Gist，若无报错则说明更新成功。 \n\n``` sh\n$ douban-box\n```\n\n另外可以通过 GitHub Actions 免费实现定时更新的功能。\n\n## 使用\n### 1. 创建 Gist\nGist 中新建名为 `douban.md` 的文件，并从 URL 中得到 Gist ID。\n\n### 2. 创建 GitHub Token\n访问 [Personal Access Tokens](https://github.com/settings/tokens) 创建更新 Gist 专用的 Token，需要勾选 `gist - Create gists` 权限，记住新生成的 Token。\n\n### 3. 获取豆瓣 ID 和 Cookie\n豆瓣 ID 是个人主页中 `people` 后紧接的那串数字或者自定义字符，例如我的主页链接 `https://www.douban.com/people/daraw/` 中是 `daraw`，在登录态下查看 Cookie，其中 `dbcl2` 是关键，复制这个 key 对应的值，构造出 `dbcl2=\"xxxxxxx\"` 即可当做 Cookie，当然把整个 Cookie 都复制过去也是可以的。\n\n### 4. 通过 GitHub Actions 自动更新 Gist\n- 创建一个 Repo 并启用 GitHub Actions，可以参考本项目的 [.github/workflows/main.yml](https://github.com/CodeDaraW/douban-box/blob/master/.github/workflows/main.yml) 文件。\n\n- 修改 `GIST_ID` 和 `DOUBAN_ID` 为刚刚所得到的 Gist ID 和豆瓣 ID。  \n\n- 为了不暴露自己的 GitHub Token 和豆瓣 Cookie，在项目的 `Settings -\u003e Secrets` 中创建两个变量 `TOKEN` 和 `DOUBAN_COOKIE`，分别为 GitHub Token 和豆瓣 Cookie。  \n\n之后每次 `push` 和每日 00:00 UTC+0 时会触发更新 Gist，如果需要修改触发时机可以调整刚刚的 GitHub Actions 配置文件。\n\n## License\n[MIT License](https://github.com/CodeDaraW/douban-box/blob/master/LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCodeDaraW%2Fdouban-box","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCodeDaraW%2Fdouban-box","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCodeDaraW%2Fdouban-box/lists"}