Skip to main content

tistorycmd

  • markdown 형식으로 작성된 파일을 html 형식으로 변환하여 티스토리에 업로드 해줍니다.

PyPI - Version PyPI - Downloads

설치

# 파일로 다운로드시
python setup.py install

# pip로 다운로드 하기
pip install tistorycmd

사용법

CMD, 터미널 창에서 실행

# 블로그 정보 보기
tistorycmd info

# 카테고리 목록 보기
tistorycmd category

# 글쓰기, 모든 내용수정시
tistorycmd post <제목> <내용|파일경로> <category_id> <태그>

# 내용만 수정
tistorycmd update <내용|파일경로>

사용시 주의사항

  • 이미지는 아래 형태대로 쓰셔야하며 한줄마다 쓰시면 자동으로 업로드 됩니다. .. code-block:

    ![screenshot1](./screenshot.png)
  • 이미지 경로가 url(http://~)이 들어간경우는 파일이 업로드되지 않고 해당 url로 해서 내용이 적용됩니다.

  • 이미지가 업로드 된경우 마크다운 파일 내용에 이미지가 업로드된 url이 자동으로 들어갑니다.

  • 글쓰기, 수정 시 해당 글들은 자동으로 발행됩니다.

기타 모듈 다운로드

pip install pyfiglet

pip install mistune (anaconda의 경우 설치 되어있습니다.)

tistorycmd 모듈 사용시

from tistorycmd import *

auth = Auth()  # 로그인, oauth, 토큰 관련 클래스
blog = Blog()  # 글쓰기, 블로그 관련 클래스

blog.info() #블로그 정보 불러오기

# 나머지는 소스 참고

설정(config.json)

  • blog_name : 블로그명 (https://[블로그명].tistory.com)

  • app_id : 앱 id (아래 #수동 api 토큰 받는 법 -> 1번 에서 확인 가능)

  • secret_key : 시크릿키 (아래 #수동 api 토큰 받는 법 -> 1번 에서 확인 가능)

  • access_code : 접근 코드, 한번 접속하면 사라짐 (아래 #수동 api 토큰 받는 법 -> 2번 에서 확인 가능)

  • access_token : 액세스 토큰 (아래 #수동 api 토큰 받는 법 -> 3번 에서 확인 가능)

수동 api 토큰 받는 법

  1. https://www.tistory.com/guide/api/manage/register 접속해서 앱등록 ( 앱등록후 앱관리에서 app id, secret key 확인 가능)

  2. https://www.tistory.com/oauth/authorize?client_id=[App id]&redirect_uri=[앱등록에서 입력한 redirect url]&response_type=code&state=someValue 접속하면 코드 확인 가능

  3. https://www.tistory.com/oauth/access_token?client_id=[App id]&client_secret=[Secret key]&redirect_uri=[앱등록에서 입력한 redirect url]&code=[2번에서 얻은 코드 값]&grant_type=authorization_code 해당 url 접속하여 access token 확인 가능

    • 2번에서 얻은 코드가 기간 만료시 아래 에러가 발생하는것 같습니다.

      This page contains the following errors:
      
      error on line 1 at column 1: Document is empty
      
      Below is a rendering of the page up to the first error.
    • 위 에러가 발생하더라도 3번 url에서 발생한 파라미터를 한번 확인해보시기 바랍니다

    • 에러 발생시 2번 내용 부터 다시 진행해 보시길 바랍니다.

참고 url

Release files for tistorycmd 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for tistorycmd 0.2.5
File Interpreter ABI Platform
tistorycmd-0.2.5-py3-none-any.whl Python 3 none any Details

Release files / tistorycmd-0.2.5-py3-none-any.whl

Download URL tistorycmd-0.2.5-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3216fae2342946a86f1ff0141b677ef4af5570f6598f3541048010b65f57ae5b
BLAKE2b-256 checksum
How to use checksums
e3183f7bc5ce820d8a8de9f9ee2344ef477cf99a0c4715b63f41f2615fb3c276
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

Release history Release notifications | RSS feed

This release

0.2.5 This release

1 release file

0.2.4

1 release file

0.2.3

1 release file

0.2.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page