본문 바로가기
글쓰기 및 블로그

N2T(Notion2Tistory) 사용법(2) - N2T 설치 및 테스트

by nineking 2023. 1. 16.

Reference

https://github.com/jmjeon94/N2T

목차

N2T(Notion2Tistory) 사용법(2) - N2T 설치 및 테스트

  1. N2T 다운로드 및 설정
  1. N2T 실행
  1. 페이지 발행

본문

N2T 다운로드 및 설정

git clone

git clone https://github.com/jmjeon94/N2T.git

패키지 설치(using pipenv)

$ pipenv install
$ pipenv run pip install -r requirements.txt

config.py 파일 수정

from utils.dotdict import dotdict

cfg = dotdict(
    TISTORY=dotdict(
        ID='kakao_login_mail', # 티스토리 로그인용 카카오 메일 주소
        PW='kakao_login_passwd',# 티스토리 로그인용 카카오 메일 암호
        BLOG_NAME='nineking', # 티스토리 블로그 주소의 이름
        SECRET_KEY='xxx' # Tistory Secret Key
        CLIENT_ID='xxx', # Tistory AppID
        REDIRECT_URI='https://nineking.tistory.com', # 티스토리 블로그 주소
    ),

    NOTION=dotdict(
        TOKEN_V2='xxx',
        TABLE_PAGE_URL='https://www.notion.so/stjeong/xxx?v=yyy', # 노션 발행 페이지 주소
        DOWNLOAD_DIR='~/.n2t',
        CODE_BLOCK_THEME='atom-one-dark',
...

N2T 실행

$ pipenv run python main.py

발행 테스트

발행할 페이지 작성

1) 발행할 페이지를 추가하고 카테고리, 태그를 입력

2) 상태에 발행 요청 입력

Trouble shooting1 : 티스토리 블로그에 존재하는 카테고리가 아닐 경우 에러 발생
Trouble shooting2 : 우리가 만든 발행 페이지의 하위로 페이지를 추가해야 정상 발행 가능. 제목에 페이지 링크만 추가하고 발행하면 빈 페이지가 업로드 된다.

페이지 발행

터미널에서 N2T 실행

$ pipenv run python main.py

상태 변경(발행 요청발행 완료) 및 링크 확인

발행 확인

추가된 링크로 접속(http://nineking.tistory.com/12)

신규 추가된 글과 함께 최하단에 Uploaded by N2T가 표기됨


Uploaded by N2T