본문 바로가기

비즈니스/돈 되는 정보

티스토리 글쓰기 자동화 3가지 방법(GPT 등)

반응형

 

 

티스토리 글쓰기 자동화 방법

gpt 티스토리 자동화

 

티스토리 블로그 글쓰기를 자동화하는 방법에는 여러 가지가 있습니다.

 

대표적으로 API 활용, Selenium 사용, 매크로 프로그램, ChatGPT API 연동 등이 있습니다.

 

✅ 1. 티스토리 Open API

티스토리는 Open API를 제공하므로

최대한 이를 활용하면 자동으로 글을 작성할 수 있습니다.

 

📌 설정 방법:

  1. 티스토리 Open API 페이지에서 애플리케이션 등록
  2. OAuth 인증을 통해 액세스 토큰 발급
  3. API를 이용해 글 작성 및 수정 가능

🛠️ 예제 코드 (Python)

import requests

ACCESS_TOKEN = "YOUR_ACCESS_TOKEN"
BLOG_NAME = "your_blog_name"
API_URL = "https://www.tistory.com/apis/post/write"

data = {
    "access_token": ACCESS_TOKEN,
    "blogName": BLOG_NAME,
    "title": "자동 작성된 글 제목",
    "content": "이 글은 API를 이용해 자동으로 작성되었습니다.",
    "visibility": 3,  # 3: 발행, 2: 보호, 0: 비공개
}

response = requests.post(API_URL, data=data)
print(response.json())
        

 

✅ 2. Selenium 활용 자동화 방법 (웹 크롤링)

API 설정이 어렵다면, Selenium을 활용해

브라우저를 자동으로 조작하는 방법도 있으니 참고하세요.

🛠️ 예제 코드 (Python + Selenium)

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time

driver = webdriver.Chrome()
driver.get("https://www.tistory.com/auth/login")

time.sleep(2)

driver.find_element(By.NAME, "loginId").send_keys("your_id")
driver.find_element(By.NAME, "password").send_keys("your_password")
driver.find_element(By.NAME, "password").send_keys(Keys.RETURN)

time.sleep(3)
driver.get("https://yourblog.tistory.com/manage/post/write")
time.sleep(2)

driver.find_element(By.NAME, "title").send_keys("자동화된 글 제목")
driver.find_element(By.CLASS_NAME, "public-DraftEditor-content").send_keys("자동 작성된 글 내용")

time.sleep(1)
driver.find_element(By.CLASS_NAME, "btn_done").click()

time.sleep(3)
driver.quit()
        

✅ 3. 매크로 프로그램 사용 (간단한 자동화)

코딩이 어렵다면 매크로 프로그램 (AutoHotkey, Macro Recorder)를 이용하는 방법도 있습니다.

 

✅ 4. Chat GPT + API 활용하기 (자동 글 생성)

ChatGPT API를 활용하면 자동으로 글을 생성하고, 이를 티스토리에 업로드할 수 있습니다.

🛠️ 예제 코드 (Python + Open AI  API)

import openai

openai.api_key = "YOUR_API_KEY"

response = openai.ChatCompletion.create(
    model="gpt-4",
    messages=[{"role": "system", "content": "티스토리에 올릴 블로그 글을 작성해줘."}]
)

generated_text = response["choices"][0]["message"]["content"]
print(generated_text)
        

🔥 결론: 어떤 방법이 좋을까?

방법 난이도 장점 단점
티스토리 API 🔥🔥🔥 공식 지원, 안정적 설정이 다소 복잡
Selenium 자동화 🔥🔥 API 없이 사용 가능 티스토리 UI 변경 시 수정 필요
매크로 프로그램 🔥 쉬운 설정 기능이 제한적
ChatGPT + API 🔥🔥🔥 자동 글 작성 가능 OpenAI API 비용 발생

👉 API 활용하면 안정적으로 자동화가 가능

👉 Selenium은 설정이 쉽지만 유지보수 필요

👉 매크로는 간단하지만 기능이 제한적

👉 Chat GPT를 활용하여 글까지 자동 생성 가능

 

위에 말씀드린 방법을 선택해서 활용하면 됩니다! 😊

 

반응형