반응형


Obsidian + Tistory 자동화 가이드
티스토리 Open API를 활용한 자동 포스팅 프로세스 정리
✅ 전체 플로우 요약
- 티스토리 API 사용 설정
- Obsidian에서 md 파일 작성
- 자동 업로드 스크립트(Node.js 또는 Python) 구성
- 실행 시 Markdown → HTML 변환 → 티스토리로 업로드
- Obsidian 플러그인 또는 단축키로 스크립트 실행 자동화
1. 티스토리 API 사용 설정
- https://www.tistory.com/guide/api/manage 에서 애플리케이션 등록
- 클라이언트 ID 및 시크릿 생성
- Redirect URI 예시:
http://localhost:3000/callback - 권한 범위:
글쓰기(write), 블로그 정보(blog), 카테고리(category) - 아래 URL로 인증 요청하여 access_token 획득
https://www.tistory.com/oauth/authorize?client_id=클라이언트ID&redirect_uri=리다이렉트URL&response_type=code
``
2. Obsidian에서 Markdown 파일 작성
- Obsidian에서
.md파일 생성 - YAML frontmatter에 제목, 태그, 카테고리 등 메타데이터 작성
---
title: 옵시디안에서 티스토리 자동 포스팅
tags: [obsidian, tistory, 자동화]
category: IT
---
Markdown으로 작성한 이 글은 자동으로 티스토리에 업로드됩니다!
---
## 3. 자동 업로드 스크립트 구성 (Node.js)
### 설치
```bash
npm init -y
npm install axios gray-matter marked
스크립트 코드 (post-to-tistory.js)
const fs = require('fs');
const matter = require('gray-matter');
const axios = require('axios');
const { marked } = require('marked');
const access_token = '여기에_티스토리_ACCESS_TOKEN';
const blogName = 'yourblog.tistory.com';
const mdFile = process.argv[2];
const content = fs.readFileSync(mdFile, 'utf8');
const { data, content: body } = matter(content);
const html = marked.parse(body);
axios.get('https://www.tistory.com/apis/post/write', {
params: {
access_token,
output: 'json',
blogName,
title: data.title,
content: html,
category: '', // 카테고리 ID
visibility: 3, // 3: 발행, 0: 비공개
tag: (data.tags || []).join(','),
},
})
.then((res) => {
console.log('업로드 성공:', res.data.tistory.url);
})
.catch((err) => {
console.error('업로드 실패:', err.response?.data || err);
});
실행
node post-to-tistory.js ./내글.md
4. Obsidian에서 자동화
방법 1: Shell Commands 플러그인
- Obsidian → Community Plugins → Shell Commands 설치
- 위 스크립트를 명령어로 등록
- 단축키 설정하여 즉시 업로드 가능
방법 2: Git 연동 및 자동화
- GitHub에
.md파일 푸시 - GitHub Actions 사용하여 포스팅 자동화
✨ Python 버전도 가능
markdown2,requests,python-frontmatter사용- 필요 시 Python 예제도 제공 가능
📌 정리
| 항목 | 내용 |
|---|---|
| 필요 도구 | Obsidian, Node.js 또는 Python |
| 티스토리 인증 | Open API + access_token |
| Markdown 변환 | marked (Node), markdown2 (Python) |
| 자동 실행 | Obsidian 플러그인 or GitHub Actions |
✅ 이런 분께 추천합니다
- Obsidian으로 콘텐츠를 정리하는 블로거
- 수동 포스팅이 번거로운 개발자
- 자동화에 관심 있는 생산성 매니아
반응형
'IT' 카테고리의 다른 글
| 영상 편집 용어와 개념 가이드 (1) | 2025.05.12 |
|---|---|
| AI 비교 가이드 Claude와 ChatGPT의 장단점 총정리! (1) | 2025.05.12 |
| 개발자라면 알아야 할 Vercel 도메인 설정 가이드 (0) | 2025.05.12 |
| Go vs Python: 최적의 사용 사례 비교 (0) | 2025.05.06 |
| Go 구조체(Struct)와 인터페이스(Interface) 비교 (0) | 2025.05.06 |
댓글