韩国博客平台Tistory最简单的命令行工具
tistory-cli的Python项目详细描述
Tistory-CLI
A command line tool for Tistory, the Korean blogging platform. It conveys Markdown files to your Tistory blog.
This project is currently in alpha stage and supports the minimal features: To post an article. It supports Linux only.
是为了韩国Tistory使用者的工具,以后用韩文说明。
Dependencies
为了Linux Secret Storage功能,需要以下包装。
- libsecret
- gnome-keyring
大部分的Linux分发板都基本安装了。Arch Linux的情况是gnome-keyring是基本的,所以要单独安装。
Installation
通过pip
可轻松安装。在系统环境或所需的虚拟环境中
$ pip install tistory-cli如果想在
或源直接安装(果然在自己想要的环境下)
$ git clone https://github.com/dgkim5360/tistory-cli-python.git
$ cd tistory-cli-python
$ python setup.py install
Features and Non-features
-
使用
- 本人的client/secret key直接登录,不会给外部服务留下秘密信息。 不保存
- 源代码、环境变量等crediential,保存在{a1}中。 以
- Git commit message风格区分题目/内容,制作Markdown文件,在Tistory上传非公开文章。
- 类别和slug可以设置。 上传
- 公开文字不做。 上传
- 图片不做。 添加
- 标签不做。
Oauth Setting
- Tistory-gt;导游-gt;开放API导游-gt;客户端注册 将
- Callback路径设定为
http://localhost:8888
(想要基本值,其他端口时.redirect-uri
文件中的相应地址一致),完成客户端注册。 tistory login
运行后(可能要求OS账户密码),将要登录的页面上传到控制台上。
通过- 浏览器进入该地址,登录Tistory获得API代币。 如果在《li》控制台上出现以下内容,登录就会结束。
Usage
$ tistory
USAGE:
tistory login
tistory logout
tistory purge
tistory category <blog_name>
tistory post <blog_name> <category_id> <file_path>
tistory login
:确认所有的秘密信息,如果没有就登录。tistory logout
:只删除Access token。tistory purge
:删除所有的秘密信息。tistory category
:接收该博客的类别信息。tistory post
:读取文件上传到相应的博客和分类中。
Step-by-step Tutorial
-
登录
- 。 通过
- ^{
}确认本人博客的分类ID。
$ tistory category dgkim5360 ID Name -- ---- 880607 HTML+CSS 880608 Django 886608 Bootstrap 892553 Python 892554 Javascript 894029 GNU-Linux 896354 뻘글 897315 Cloud 907471 etc 908711 Front-end 912687 Machine Learning 931755 NBA 933686 Elastic 937655 Flask 951477 Javascript 959045 Travelogue 990157 Rust
- ^{
}文件像Git commit message一样填写(第一行题目,一行开始内容)。文章内容是按照Markdown的格式来写的。(文件名:^{ })
[제목]Hello Tistory! # Tistory-cli 테스트 중입니다. 아래는 list * hello * tistory * bye * tistory 1. hello 1. tistory 1. bye 1. tistory 이것은 [링크](http://dgkim5360.tistory.com) Inline `code text`도 써봅니다.
- ^{
}确定后,在Tistory确认。完成任务后,该Markdown文档的文件前会加上Tistory系统的ID值(以下例子中有191)。
$ tistory post dgkim5360 896354 path/to/tistory-cli-test.md
$ ls path/to
191_tistory-cli-test.md
-
添加
- 所需的图像,添加标签,公开设置在Tistory中解决。
- 项目
标签: