Skip to content

Instantly share code, notes, and snippets.

@rahulbanerjee26
Created September 25, 2022 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahulbanerjee26/b339fb24ff8c121c4a31510c41ad20dc to your computer and use it in GitHub Desktop.
Save rahulbanerjee26/b339fb24ff8c121c4a31510c41ad20dc to your computer and use it in GitHub Desktop.
wp_post_content_html = markDownToHtml(wp_markdown_content)
wp = WordpressPoster(domain, WP_USERNAME, WP_PASSWORD)
featuredImageID = wp.upload_media('./image.jpeg').get('id')
categoryIDs = wp.get_category_ids(["tutorial"])
tagIDs = wp.get_tag_ids(['python','ai'])
wp_response = wp.create_post_wordpress(
title, wp_post_content_html, "draft", categoryIDs, tagIDs, featuredImageID
)
wp_post_url = wp_response.get("guid").get("raw")
print(f"Find WordPress Post: {wp_post_url}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment