Convert your hexo markdown posts to html then publish to your wordpress blog.
├── .env
├── .gitignore
├── LICENSE
├── README.md
├── blog_uploader
│ ├── __init__.py
│ ├── config.py
│ ├── main.py
│ ├── markdown_parser.py
│ └── wordpress_publisher.py
└── image_scraper.py
Before use this script, you should make sure your post was created by hexo command or it has a hexo post format:
---
title: Your post title
date: 2021-04-01 20:16:49
tags: [Python]
---
...content...
install python-wordpress-xmlrpc
pip install python-wordpress-xmlrpc
read the python-wordpress-xmlrpc doc to get the your wordpress xmlrcpath.
fill your xmlrcpath, user name and passwd in .env.
WORDPRESS_XMLRCPATH=https://blog.1kye.com/xmlrpc.php
WORDPRESS_USER_NAME=YourName
WORDPRESS_USER_PASSWD=Password
then you can upload your post to your wordpress blog.
python -m blog_uploader.main file
usage: image_scraper.py [-h] [-s STYLE] [-n COUNT] dir
positional arguments:
dir 存储图片目录
optional arguments:
-h, --help show this help message and exit
-s STYLE, --style STYLE
下载图片的风格
-n COUNT, --count COUNT
批量下载的个数
python image_scraper.py imgs -s code -n 10
python -m blog_uploader.main mds imgs