Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Publish to blogger
# 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.
# If post-id doesnt already exist,
if not post_id:
command = f'easyblogger.exe post -t "{title}" -l "{", ".join(labels)}" -f "{html_file}"'
command = f'easyblogger.exe update -t "{title}" -l "{", ".join(labels)}" -f "{html_file}" {post_id}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment