Created
September 25, 2022 22:36
-
-
Save rahulbanerjee26/b339fb24ff8c121c4a31510c41ad20dc to your computer and use it in GitHub Desktop.
This file contains 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
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