{"id":15960909,"url":"https://github.com/dragon-fish/mw-bot-samples-node","last_synced_at":"2026-04-19T05:37:08.746Z","repository":{"id":142359919,"uuid":"442073818","full_name":"dragon-fish/mw-bot-samples-node","owner":"dragon-fish","description":"一些使用 Node.js 维护 wiki 的自动程序（bot）的示例代码。","archived":false,"fork":false,"pushed_at":"2023-07-16T13:22:53.000Z","size":39,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T11:39:35.376Z","etag":null,"topics":["mediawiki","mediawiki-bot","sample-project"],"latest_commit_sha":null,"homepage":"https://zh.moegirl.org.cn/index.php?curid=492649","language":"JavaScript","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/dragon-fish.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-27T06:40:22.000Z","updated_at":"2024-01-08T14:39:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"d83e813b-fd4b-45aa-8173-3196b30d4a44","html_url":"https://github.com/dragon-fish/mw-bot-samples-node","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"76b2b243e918b44b67d813ff550204824aeb7858"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dragon-fish/mw-bot-samples-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragon-fish%2Fmw-bot-samples-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragon-fish%2Fmw-bot-samples-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragon-fish%2Fmw-bot-samples-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragon-fish%2Fmw-bot-samples-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dragon-fish","download_url":"https://codeload.github.com/dragon-fish/mw-bot-samples-node/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragon-fish%2Fmw-bot-samples-node/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268334081,"owners_count":24233782,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["mediawiki","mediawiki-bot","sample-project"],"created_at":"2024-10-07T15:22:33.680Z","updated_at":"2026-04-19T05:37:08.700Z","avatar_url":"https://github.com/dragon-fish.png","language":"JavaScript","readme":"# 使用 Node.js 编辑 MediaWiki\n\n这个仓库包含了一些使用 Node.js 维护 wiki 的自动程序（bot）的示例代码。\n\n建议搭配此说明使用：https://zh.moegirl.org.cn/index.php?curid=492649\n\n## 初始化工程\n\n```bash\n# 首先，克隆本仓库到本地\ngit clone git@github.com:Dragon-Fish/mw-bot-samples-node\n# 进入文件夹\ncd mw-bot-samples-node\n# 安装依赖\nnpm install\n\n# 我们推荐使用 pnpm 管理依赖，参见：https://pnpm.io/\n# 若使用 pnpm，请使用该指令安装依赖：\npnpm install\n```\n\n## 文件结构说明\n\n初始化工程后，文件结构应该看起来像是这样的：\n\n```\nmw-bot-samples-node\n├── node_modules/*\n└── src\n    ├── utils/*\n    ├── 00-*.js\n    └── bot.js\n├── .env.sample\n└── package.json\n```\n\n- `node_modules`文件夹：这里是您在上一步中 npm 为您安装的依赖包，一般来说您不需要改动这个文件夹\n- `src`文件夹：\n  - `bot.js`文件：可复用的 bot 实例\n  - 形如`[数字]-[名称].js`的一批文件：这些就是示例代码，您可以尝试按顺序阅读并理解它们，您也可以根据需要自行改动\n- `.env.sample`文件：配置文件参考\n- `package.json`文件：这个文件包含了项目的配置信息，包括依赖及其版本号，一般来说您不需要改动这个文件。如果您知道自己在干什么，也可以根据需要自行改动\n\n## 如何运行示例代码\n\n1. 首先，找到文件 [.env.sample](.env.sample)，复制该文件到当前目录，重命名为`.env`（简单来说，移除文件名中的`.sample`），并将其中的配置信息替换为您自己的\n   1. 警告：不要直接修改 `.env.sample`\n   2. 警告：不要将 `.env` 推送到远端或者分享给其他人\n2. 从`src`文件夹找到你感兴趣的示例，按需求进行改动，然后使用`node`命令运行它\n   - 举个例子：您可以通过`node src/01-hello-world.js`运行第一个示例。\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdragon-fish%2Fmw-bot-samples-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdragon-fish%2Fmw-bot-samples-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdragon-fish%2Fmw-bot-samples-node/lists"}