tags where appropriate - Write in a first-person plural format (we, us, our, ours) - Include and naturally incorporate as many of these keywords: {keywords_array} - Include these key phrases: {keyphrases} - Write in the language of keywords/phrases if they are not in English - Mandatorily localize the content if location names are available in keywords - Base Farmonaut-specific information solely on this context: {farmonaut_info} - Do not include case studies, success stories, or any hallucinated information about Farmonaut - Add all the images from this JSON object: {post_data['media']} with border-radius:16px, box-shadow: 10px 10px 15px, cursor: pointer. These images should open https://farmonaut.com/app_redirect when clicked. All images should be placed within 75% content of the blog. - Embed the playable YouTube videos available in the format [('video_title', 'video_id')]: {suggested_videos}. Create the full YouTube video URL: https://youtube.com/watch?v=video_id from the video_id. Uniformly add these videos within top 75% content of the blog. width: 100%, height: 500px, border-radius: 16px, box-shadow: 10px 10px 15px. - Add a beautifully formatted table based on this context: {table_info} - Add these trivias at the top and middle of the blog post: {trivias}. Make the trivia text bold, italic, within double-quotes, font-size: 50px, line-height: 50px, color: #034d5c - Add links: - App Button Image: https://farmonaut.com/Images/web_app_button.png, Link on this button: https://farmonaut.com/app_redirect, height: 80px - API: https://sat.farmonaut.com/api - API Developer Docs: https://farmonaut.com/farmonaut-satellite-weather-api-developer-docs/ - Android App Button Image: https://farmonaut.com/wp-content/uploads/2020/01/get_it_on_google_play.png, Link on this Button: https://play.google.com/store/apps/details?id=com.farmonaut.android, height: 80px - iOS App Button Image: https://farmonaut.com/wp-content/uploads/2020/01/available_on_app_store.png, Link on this Button: https://apps.apple.com/in/app/farmonaut/id1489095847, height: 80px - Earn With Farmonaut: Link https://farmonaut.com/affiliate-program, YouTube Video URL: https://www.youtube.com/watch?v=QydYrdtPBP0, Summary about this program: Earn 20% recurring commission with Farmonaut's affiliate program by sharing your promo code and helping farmers save 10%. Onboard 10 Elite farmers monthly to earn a minimum of $148,000 annually—start now and grow your income! Formatting: Make the text bold and larger than blog text size. - Distribute these links within top 75% content of the blog with bold font - Add this custom HTML for Farmonaut subscriptions: {stripe_html} - Add an FAQ section - Use bullet points and subheadings (font color: #034d5c) to improve readability - Make the content mobile responsive Additional guidelines: - Do not mention any partnership or collaboration of any sort with anyone in the blog - Achieve Flesch Reading Ease Score of at least 60 - Provide detailed explanations and examples - Ensure all content is factual and based on provided information - Organize information logically with clear transitions between sections - Use varied sentence structures and vocabulary for engaging reading - Farmonaut is not an: a. Online marketplace b. Manufacturer/seller of farm inputs or farm machinery c. Regulatory body Keep this in mind while writing the summary - Mandatorily implement all the latest SEO guidelines provided by Yoast SEO: {yoast_guidelines2} Please generate the blog post based on these requirements, ensuring it's well-structured and at least 3500 words long.''' blog_content = call_genai(prompt, 1, 8000) category_ids = { "south-america": 580, "asia": 579, "africa": 578, "united-kingdom": 577, "canada": 576, "europe": 575, "australia": 574, "blogs": 5, "news": 573, "case_study": 546, "area_estimation": 542, "remote_sensing": 9, "precision_farming": 548, "api_development": 572, "usa": 561 } prompt = f'Based upon this title: {title}, and caption: {caption} , 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 ValueError: category_id = 5 # Default category 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] prompt = f"Can you convert this text into a URL slug. Don't output any other text. Text to convert to URL slug: {title}" slug = call_genai(prompt, 0, 500).strip() try: schema_media = [post_data['media'][0]['url'], post_data['media'][1]['url']] except Exception: print(traceback.format_exc()) schema_media = media_url_arr structured_schema_script = (f'') post_data["content"] = structured_schema_script + blog_content publish_or_update_wordpress_post(wp_url, wp_username, wp_password, post_data) # save_to_file('posts_done.txt', str(done_posts)) time.sleep(interval) except Exception: print(traceback.format_exc()) time.sleep(70) remove_all_files_in_folder('insta_files') except: print(traceback.format_exc()) main()