9

Github图床工具

 3 years ago
source link: http://www.z16388.top/2019/11/17/picupdate/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Github图床工具

2019-11-17

33

这是一个上传图片到github的工具,目前还不是很成熟,不过已经可以实现压缩并上传图片的目的了,对于写博客来说已经够用了。

  1. 创建todo目录
  2. 创建pic目录,在github上创建一个空项目,然后pull到这里
  3. 修改配置文件,将git_url修改为上一步新建的项目
  4. 将图片放到todo文件夹下

需要注意的是,因为图床需要一个git目录,同时代码也需要。在使用部分git管理工具时会禁止这种目录的嵌套。因此最好将代码独立运行。可以自己打包,也可以使用我打好的可执行程序。

在这里需要提一句,一般如果只想要下载github上项目的一个目录或者一个文件,可以使用svn进行下载。将文件路径中的文件名/master替换为trunk即可使用下载。

经过配置之后,以后只需要将图片放到todo目录下,执行脚本即可。

编译时需要安装以下运行库

pip install pyyaml
pip install gitpython
pip install pillow

Ver.0.2 2019-11-17 提交编译的可执行程序;增加配置文件

Ver.0.1 2019-11-12 提交项目

最后更新时间:2019-11-17 18:33:15

梦想依在 人生正当年


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK