, blocks wherever necessary in informational tone and as a first-person plural (we, us, our, ours) mandatorily including the following keywords: {keywords} \n\n The blog needs to be at least 5000 words in length. Please don't include any hallucinated information about Farmonaut in the blog. Please don't include any case study in the blog. To add any more details in the blog related to Farmonaut, use information from this text and further elaborate on it if necessary: {farmonaut_info} \n\n Strictly Incorporate these keywords into the blog: {keywords_formatted}. If any of the keywords look unrelated and out of context to the blog, then don't add them to the blog. Add Images (URLs) from this JSON object {post_data['media']} into the blog in blocks wherever necessary including the absolute top of the blog. If it matches with the theme of the blog, add a table of how Farmonaut Satellite System is better than drone and IoT based farm monitoring. Add links to https://farmonaut.com/app_redirect, https://sat.farmonaut.com/api, https://play.google.com/store/apps/details?id=com.farmonaut.android, https://apps.apple.com/in/app/farmonaut/id1489095847, https://farmonaut.com/farmonaut-satellite-weather-api-developer-docs/ wherever necessary. Include this custom HTML code for subscribing to Farmonaut: {stripe_html} \n Add bullet points and subheadings wherever necessary. Please include an FAQ section as well." blog_content = call_genai(prompt, 1, 8000) # print(blog_content) category_ids = "blogs: 5, case_study:546, area_estimation:542, remote_sensing:9, precision_farming:548, api_development:572, usa:561" prompt = f'Based upon this title: {title} , identify the best category id in which this title fits in: {category_ids}. Strictly only return the integer value as the response' category_id = call_genai(prompt, 0, 5) try: category_id = int(category_id) except: category_id = 5 #publish_to_wordpress(title, blog_content, post_data['media'], post_data['caption'], category_id) post_data['title'] = title post_data['content'] = blog_content post_data['status'] = 'publish' post_data['excerpt'] = caption post_data['comment_status'] = 'open' post_data['categories'] = [category_id] publish_or_update_wordpress_post(wp_url, wp_username, wp_password, post_data) done_posts.append(post_num) save_to_file('posts_done.txt', str(done_posts)) except: print(traceback.format_exc()) remove_all_files_in_folder('insta_files') time.sleep(60*60) main()