{"id":21998864,"url":"https://github.com/lyy289065406/crop-circles","last_synced_at":"2025-04-30T21:43:52.804Z","repository":{"id":39109824,"uuid":"200167219","full_name":"lyy289065406/crop-circles","owner":"lyy289065406","description":"Github 麦田圈","archived":false,"fork":false,"pushed_at":"2025-04-25T01:17:14.000Z","size":13382,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-25T02:32:01.900Z","etag":null,"topics":["circle","crop","plant","programming"],"latest_commit_sha":null,"homepage":"https://lyy289065406.github.io/crop-circles/","language":"Python","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/lyy289065406.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["https://lyy289065406.github.io/sponsor/"]}},"created_at":"2019-08-02T04:50:47.000Z","updated_at":"2025-04-25T01:17:18.000Z","dependencies_parsed_at":"2023-12-21T13:08:19.733Z","dependency_job_id":"e92c76c0-6e8e-4c7b-9fad-454078b7cb1b","html_url":"https://github.com/lyy289065406/crop-circles","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/lyy289065406%2Fcrop-circles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyy289065406%2Fcrop-circles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyy289065406%2Fcrop-circles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyy289065406%2Fcrop-circles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lyy289065406","download_url":"https://codeload.github.com/lyy289065406/crop-circles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251789225,"owners_count":21644077,"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":["circle","crop","plant","programming"],"created_at":"2024-11-29T22:26:52.345Z","updated_at":"2025-04-30T21:43:52.783Z","avatar_url":"https://github.com/lyy289065406.png","language":"Python","funding_links":["https://lyy289065406.github.io/sponsor/"],"categories":[],"sub_categories":[],"readme":"# crop-circles\r\n\r\n\u003e Github 麦田圈\r\n\r\n------\r\n\r\n## 运行环境\r\n\r\n![](https://img.shields.io/badge/Python-3.8%2B-brightgreen.svg)\r\n\r\n\r\n## 脚本介绍\r\n\r\n用一年时间在 Github Profile 画一幅像素画（[查看进度](https://lyy289065406.github.io/crop-circles/)）：\r\n\r\n![草地](imgs/grassland.png)\r\n\r\n\r\n## 实现原理\r\n\r\nGithub Profile 有一片 “草地” ，每天会从上到下、从左到右滚动更新。\r\n\r\n其中每一列从周日开始，每一格的颜色根据当天的提交次数呈现不同的绿色深度：\r\n\r\n- 0 次 ： 灰色\r\n- \u0026lt; 16 次 ： 浅绿\r\n- \u0026lt; 32 次 ： 翠绿\r\n- \u0026lt; 64 次 ： 深绿\r\n- \u0026gt;= 64 次 ： 墨绿\r\n\r\n利用这个特征，通过 [Crontab](https://github.com/lyy289065406/cron-expression) 或 [Actions](https://docs.github.com/cn/actions/configuring-and-managing-workflows/configuring-a-workflow) 控制每天的提交次数，就可以实现全自动绘制麦田圈。\r\n\r\n\r\n## 开发者部署\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cb\u003e无服务器方式（推荐）\u003c/b\u003e\u003c/summary\u003e\r\n\u003cbr/\u003e\r\n\r\n本项目已配置 [Github Actions](https://docs.github.com/cn/actions/configuring-and-managing-workflows/configuring-a-workflow)，因此你只需轻松几步即可实现部署：\r\n\r\n- [Fork 本项目](https://github.com/lyy289065406/crop-circles) 到你的代码仓库\r\n- 通过 Settings --\u003e Secrets 配置 3 个环境变量：\r\n\u003cbr/\u003e　　`LOGO`： 期望绘制到 Github Profile 的字符串，如 `EXP-REPO`\r\n\u003cbr/\u003e　　`GIT_USER`： Github 用户名\r\n\u003cbr/\u003e　　`GIT_EMAIL`： Github 邮箱（与 owner 一致才能确保 commit 有效，否则 commit 不会被记录，也就无法实现绘画）\r\n- 创建 [GITHUB_TOKEN](https://github.com/settings/tokens) （若已有则不需要重复创建）：用于 [Github Actions](https://docs.github.com/cn/actions/configuring-and-managing-workflows/configuring-a-workflow) 登录并提交变更（最小权限要求为 `admin:repo_hook, repo`）\r\n- 启用 Settings --\u003e Actions 功能\r\n\r\n\u003e 程序默认每 20 分钟执行一次（若要调整执行频率，可修改 [`autorun.yml`](.github/workflows/autorun.yml) 的 `schedule` 触发时点）；另 Github Actions 的 runner 与北京时间有 8 小时时差，而 Github Profile 是准时在北京时间 00:00 刷新的，因此实际每天可用时间只有 16 小时。\r\n\r\n![Secrets](imgs/secrets.png)\r\n\r\n![Token](imgs/GITHUB_TOKEN.png)\r\n\r\n\u003e `GITHUB_TOKEN` 是所有仓库通用的环境变量，只需生成一次，详细可参看 [官方教程](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)\r\n\r\n\u003c/details\u003e\r\n\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cb\u003e有服务器方式\u003c/b\u003e\u003c/summary\u003e\r\n\u003cbr/\u003e\r\n\r\n- 任意找一台 Linux 服务器（阿里云、腾讯云等）\r\n- 安装 python 3.8\r\n- 安装 GitPython 模块： `sudo pip install GitPython`\r\n- 安装 git 客户端\r\n- 在 Github Fork 这个仓库： [https://github.com/lyy289065406/crop-circles](https://github.com/lyy289065406/crop-circles)\r\n- 把仓库 checkout 到服务器本地： `git clone https://github.com/{{your_repo}}/crop-circles`\r\n- checkout 的位置任意即可，如： `/tmp/crop-circles`\r\n- 设置使用 SSH 与 Github 连接（避免提交内容时要输入账密），详见 [这里](https://help.github.com/en/articles/connecting-to-github-with-ssh)\r\n- 若设置 SSH 后还要输入密码才能提交，则还需要把仓库的 https 协议改成 ssh，详见 [这里](https://help.github.com/en/articles/changing-a-remotes-url#switching-remote-urls-from-https-to-ssh)\r\n- 修改 crontab 配置文件，设置定时任务： `crontab -e`\r\n- 设置定时任务命令（每小时）： `0 * * * * python /tmp/crop-circles/main.py -logo \"YOUR-LOGO\"`\r\n- 保存 crontab 配置文件后会自动生效，查看日志： `tail -10f /var/log/cron`\r\n\r\n\u003c/details\u003e\r\n\r\n\r\n## LOGO 限制\r\n\r\n- 支持的字符范围： 大写字母 `A-Z`， 数字 `0-9`， 以及部分英文符号\r\n- LOGO 宽度： 总宽度 `\u003c=` 53\r\n\r\n其中：\r\n\r\n- 字母宽度： 固定值 7\r\n- 数字宽度： 固定值 7\r\n- 符号宽度： 固定值 3\r\n\r\n\u003e 查看支持字符的命令： `python main.py -v`\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003e\u003cb\u003e支持绘制的字符清单\u003c/b\u003e\u003c/summary\u003e\r\n\u003cbr/\u003e\r\n\r\n| character | width | character | width |\r\n|:----:|:----:|:----:|:----:|\r\n| `A` | `7` | `B` | `7` |\r\n| `C` | `7` | `D` | `7` |\r\n| `E` | `7` | `F` | `7` |\r\n| `G` | `7` | `H` | `7` |\r\n| `I` | `7` | `J` | `7` |\r\n| `K` | `7` | `L` | `7` |\r\n| `M` | `7` | `N` | `7` |\r\n| `O` | `7` | `P` | `7` |\r\n| `Q` | `7` | `R` | `7` |\r\n| `S` | `7` | `T` | `7` |\r\n| `U` | `7` | `V` | `7` |\r\n| `W` | `7` | `X` | `7` |\r\n| `Y` | `7` | `Z` | `7` |\r\n| `0` | `7` | `1` | `7` |\r\n| `2` | `7` | `3` | `7` |\r\n| `4` | `7` | `5` | `7` |\r\n| `6` | `7` | `7` | `7` |\r\n| `8` | `7` | `9` | `7` |\r\n| `(` | `3` | `)` | `3` |\r\n| `[` | `3` | `]` | `3` |\r\n| `{` | `3` | `}` | `3` |\r\n| `\u003c` | `3` | `\u003e` | `3` |\r\n| `·` | `3` | `.` | `3` |\r\n| ` ` | `3` | `,` | `3` |\r\n| `;` | `3` | `:` | `3` |\r\n| `?` | `3` | `!` | `3` |\r\n| `$` | `3` | `^` | `3` |\r\n| `*` | `3` | `=` | `3` |\r\n| `+` | `3` | `-` | `3` |\r\n| `_` | `3` | `|` | `3` |\r\n| `\\` | `3` | `/` | `3` |\r\n| `'` | `3` |   |   |\r\n\r\n\u003c/details\u003e\r\n\r\n\r\n## 版权声明\r\n\r\n　[![Copyright (C) EXP,2016](https://img.shields.io/badge/Copyright%20(C)-EXP%202016-blue.svg)](http://exp-blog.com)　[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\r\n\r\n- Site: [http://exp-blog.com](http://exp-blog.com) \r\n- Mail: \u003ca href=\"mailto:289065406@qq.com?subject=[EXP's Github]%20Your%20Question%20（请写下您的疑问）\u0026amp;body=What%20can%20I%20help%20you?%20（需要我提供什么帮助吗？）\"\u003e289065406@qq.com\u003c/a\u003e\r\n\r\n\r\n------\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flyy289065406%2Fcrop-circles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flyy289065406%2Fcrop-circles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flyy289065406%2Fcrop-circles/lists"}