Created
December 31, 2017 11:36
-
-
Save durgaswaroop/20bef02450137907d01f794ba99b965c to your computer and use it in GitHub Desktop.
Publish to blogger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Call easyblogger | |
# Client secret and authentication is already stored in ~/.easyblogger.credentials | |
# blogid is stored in ~/.easyblogger | |
import subprocess | |
import blogger_modifications | |
def publish(html_file, title, labels, post_id): | |
# print('publishing', html_file, 'with title', title, 'labels', labels, 'and post-id', post_id, flush=True) | |
# Modify html as needed. | |
blogger_modifications.modify(html_file) | |
# If post-id doesnt already exist, | |
if not post_id: | |
command = f'easyblogger.exe post -t "{title}" -l "{", ".join(labels)}" -f "{html_file}"' | |
else: | |
command = f'easyblogger.exe update -t "{title}" -l "{", ".join(labels)}" -f "{html_file}" {post_id}' | |
subprocess.run(command) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment