{"id":17871226,"url":"https://github.com/stulzq/dotnet-cnblogs-tool","last_synced_at":"2025-03-21T16:31:13.008Z","repository":{"id":39815401,"uuid":"133520593","full_name":"stulzq/dotnet-cnblogs-tool","owner":"stulzq","description":"博客园文章快捷发布工具","archived":false,"fork":false,"pushed_at":"2022-07-29T09:05:20.000Z","size":2380,"stargazers_count":168,"open_issues_count":6,"forks_count":35,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-05-22T12:05:31.858Z","etag":null,"topics":["cnblogs"],"latest_commit_sha":null,"homepage":"","language":"C#","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/stulzq.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":"2018-05-15T13:30:41.000Z","updated_at":"2024-05-15T09:28:15.000Z","dependencies_parsed_at":"2022-07-05T17:02:51.486Z","dependency_job_id":null,"html_url":"https://github.com/stulzq/dotnet-cnblogs-tool","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stulzq%2Fdotnet-cnblogs-tool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stulzq%2Fdotnet-cnblogs-tool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stulzq%2Fdotnet-cnblogs-tool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stulzq%2Fdotnet-cnblogs-tool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stulzq","download_url":"https://codeload.github.com/stulzq/dotnet-cnblogs-tool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244829489,"owners_count":20517309,"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":["cnblogs"],"created_at":"2024-10-28T10:27:40.892Z","updated_at":"2025-03-21T16:31:12.704Z","avatar_url":"https://github.com/stulzq.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dotNet 博客园工具 \n\n[![](https://img.shields.io/nuget/v/dotnet-cnblog.svg?style=flat-square\u0026label=nuget)](https://www.nuget.org/packages/dotnet-cnblog)\n\n## 一.前言\n\n此工具解决的痛点是在本地编辑的 Markdown 文件里包含的图片，在博客园发布时，需要手动一张张的复制到博客园的编辑器中上传，十分麻烦，此文中有详细说明：[如何高效的编写与同步博客 （.NET Core 小工具实现）](https://www.cnblogs.com/stulzq/p/9043632.html)\n\n## 二.安装工具\n\n（1）具有 .NET Core/.NET 5 环境可以直接使用命令安装：\n\n````shell\ndotnet tool install --global dotnet-cnblog\n````\n\n（2）如果没有上面的环境，那么可以直接下载二进制文件 \n\n下载地址： https://github.com/stulzq/dotnet-cnblogs-tool/releases\n\n\u003e 因为本工具是开源的，而且使用过程中需要输入 Token，所以不要相信任何第三方下载，因为它们有可能被植入恶意代码，仅提供上面两种方式。\n\n## 三.使用\n\n第一次运行需要配置博客ID，账号、Token等，按照提示输入即可，对密码采用tea加密算法进行加密存储。\n\n![](assets/668104-20201127164440482-852371747.png)\n\n\u003e需要账号、Token 是因为调用 MetaWeblog API 需要此信息\n\nToken 申请：https://i.cnblogs.com/settings\n\n![image](https://user-images.githubusercontent.com/13200155/176429548-bf374aa6-b16f-4b12-a464-c5adcaa86d14.png)\n\n2022.6.29 更新，请使用 MetaWeblog Token 替换原来的账户密码！！！\n\n### 重置配置\n\n使用下面的命令重置配置:\n\n````shell\ndotnet-cnblog reset\n````\n![](assets/668104-20201127164512348-139991479.png)\n\n### 四.上传图片\n\n对Markdown文件里的图片进行解析，上传到博客园，并且转换内容保存到新的文件中。\n\n````shell\ndotnet-cnblog proc -f \u003cmarkdown文件路径\u003e\n````\n![](assets/668104-20201127164728833-2082113229.png)\n\n处理过的内容保存在 `Markdown 原始文件名-cnblog.md` 中，复制粘贴到博客园的编辑器发布即可。\n\n## 五.其他说明\n\n- 程序未加过多的容错机制，请勿暴力测试。比如发送一个非MarkDown文件到程序。\n\n- 上传图片具有重试机制，重试三次。\n\n- 只有本地路径的图片才会上传，所有http/https远程图片都会过滤\n\n- 图片上传完毕以后，会自动转换md内容保存到带`cnblog`后缀的文件里面\n\n- 密码错误请重置配置\n\n若上传接口报错，请到博客园后台设置  https://i.cnblogs.com/settings\n\n![](assets/668104-20201127164901378-1830341075.png)\n\n\nWindows 设置右键菜单的方法 https://www.cnblogs.com/shengliC/p/14410298.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstulzq%2Fdotnet-cnblogs-tool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstulzq%2Fdotnet-cnblogs-tool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstulzq%2Fdotnet-cnblogs-tool/lists"}