Submit and check indexing status of Tistory blog posts via Google's Indexing API
Project description
tistory-indexer
티스토리(Tistory) 블로그 글을 자동으로 Google Search Console (GSC)에 색인 요청하는 파이썬 라이브러리입니다.
✅ 블로그가 GSC에 등록되어 있어야 하며, OAuth 인증이 필요합니다.
🚀 주요 기능
- 티스토리 블로그에서 전체 글 자동 수집 (가장 최근 수정된 글부터 순서대로 처리)
- Google Indexing API를 통해 자동 색인 요청
- 이미 색인된 글은 건너뜀 (중복 방지)
- 크론(cron) 또는 GitHub Actions로 자동 실행 가능
📦 설치 방법
Python 3.11 이상에서 다음 명령어로 설치할 수 있습니다:
pip install tistory-indexer
⚙️ 사전 준비
- Google Cloud Console에서 프로젝트 생성
- Web Search Indexing API, Google Search Console API 활성화
- OAuth 클라이언트 ID 생성 (애플리케이션 유형: 데스크톱 앱)
- JSON 형식의 클라이언트 ID 파일 다운로드 (예: oauth_credentials.json)
- OAuth 동의 화면 > 대상 > 테스트 사용자에서 자신의 이메일 주소를 추가
🧪 사용 방법
from tistory_indexer import TistoryIndexer
indexer = TistoryIndexer(
tistory_blog_url="https://your-blog.tistory.com",
oauth_credentials_path="oauth_credentials.json"
)
indexer.run(pages=5) # 가장 최근 수정된 글 중 최대 5개 색인 요청
⚙️ 옵션 설명
| 옵션 | 설명 |
|---|---|
| tistory_blog_url | 티스토리 블로그 주소 |
| oauth_credentials_path | OAuth 클라이언트 키(JSON) 파일 경로 |
🔄 자동 실행 예시
🖥 로컬에서 크론(cron) 설정
0 0 * * * /usr/bin/python3 /path/to/main.py
☁️ GitHub Actions 예시
on:
schedule:
- cron: "0 0 * * *"
jobs:
index:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- run: pip install tistory-indexer
- run: python main.py
📋 요구 사항
- Python 3.11 이상
- 설치 시 다음 의존성이 자동으로 포함됩니다:
- google-auth
- google-auth-oauthlib
- requests
- beautifulsoup4
- lxml
📜 라이선스
MIT License © 2025 OuOHoon
GitHub: @ouohoon
자세한 내용은 LICENSE 파일을 참고하세요.
☕ 후원하기
이 프로젝트가 도움이 되었다면 후원을 고려해주세요!
🙋 자주 묻는 질문 (FAQ)
Q. OAuth 인증은 어떻게 하나요?
- 최초 실행 시 브라우저를 통해 Google 로그인 창이 나타납니다. 로그인 후 생성된 token.json 파일이 자동 저장되며, 이후에는 자동으로 인증됩니다.
Q. 색인 요청을 자주 보내도 되나요?
- Google Indexing API는 무료 사용자의 하루 요청 횟수에 제한(기본적으로 200개)이 있습니다. 무분별한 요청은 피해주세요.
Q. API로 색인 상태를 조회하면 "NEUTRAL"이 뜨는데, GSC에서는 "색인 등록됨"이라고 나와요. 왜 그런가요?
- Google Search Console API에서 반환하는
verdict값은 실시간 검사 결과 또는 제한된 분석 기반으로 판단됩니다. 실제 색인 상태와 달리 "NEUTRAL"로 나올 수 있으며, 이는 색인이 안 됐다는 의미는 아닙니다. - 색인 여부는 GSC 웹 UI의 색인 상태도 함께 참고하는 것이 좋습니다.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tistory_indexer-0.1.0.tar.gz.
File metadata
- Download URL: tistory_indexer-0.1.0.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
adb59df38ee25495f93474c10c23c3a7d2eec4ca5c76b119a4a1bdda2313d79c
|
|
| MD5 |
113b7a6ef4096e67bb5e3f880a00474a
|
|
| BLAKE2b-256 |
dcf9db302b6456f2abdd01442da32bdf81d967c31c5724f359982cb3621da4c3
|
File details
Details for the file tistory_indexer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tistory_indexer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04cd84bd68bff33cf32a8b841aa0ed653be0c917ba342f8cdc687518820bb45e
|
|
| MD5 |
62864ff0b29254dbdef52cb5eee1b025
|
|
| BLAKE2b-256 |
50690781953700d2764654d23c1335ddca28d7914e03e9c7e34cc994bb18f6e2
|