GitHub Action commited on
Commit ·
1950f68
1
Parent(s): b71cb5e
Sync from GitHub with Git LFS
Browse files
scripts/publish_to_blogger.py
CHANGED
|
@@ -8,7 +8,10 @@ import markdown2
|
|
| 8 |
TOKEN_FILE = os.environ.get('TOKEN_FILE', 'token.pkl')
|
| 9 |
BLOG_ID = os.environ['BLOG_ID']
|
| 10 |
POSTS_DIR = 'docs'
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
if os.path.exists(JSON_FILE):
|
| 14 |
with open(JSON_FILE, 'r', encoding='utf-8') as f:
|
|
@@ -18,7 +21,6 @@ if os.path.exists(JSON_FILE):
|
|
| 18 |
published = {}
|
| 19 |
else:
|
| 20 |
published = {}
|
| 21 |
-
|
| 22 |
# Загружаем OAuth токен
|
| 23 |
with open(TOKEN_FILE, 'rb') as f:
|
| 24 |
creds = pickle.load(f)
|
|
|
|
| 8 |
TOKEN_FILE = os.environ.get('TOKEN_FILE', 'token.pkl')
|
| 9 |
BLOG_ID = os.environ['BLOG_ID']
|
| 10 |
POSTS_DIR = 'docs'
|
| 11 |
+
|
| 12 |
+
# Путь к текущему скрипту
|
| 13 |
+
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 14 |
+
JSON_FILE = os.path.join(SCRIPT_DIR, 'published_posts.json')
|
| 15 |
|
| 16 |
if os.path.exists(JSON_FILE):
|
| 17 |
with open(JSON_FILE, 'r', encoding='utf-8') as f:
|
|
|
|
| 21 |
published = {}
|
| 22 |
else:
|
| 23 |
published = {}
|
|
|
|
| 24 |
# Загружаем OAuth токен
|
| 25 |
with open(TOKEN_FILE, 'rb') as f:
|
| 26 |
creds = pickle.load(f)
|