پرش به محتوای اصلی
دانشگاه هوش مصنوعی — Daneshgah AI
برنامه‌نویسی و اتوماسیونخروجی: متنسطح: پیشرفته

پرامپت ساخت ربات پایتون برای ارسال خودکار پست در اینستاگرام

این پرامپت یک اسکریپت تمام‌خودکار، امن و ساختاریافته به پایتون برای تولید و ارسال پست‌های اینستاگرام تولید می‌کند.

1. Monday: Cozy corners, minimalist style! 🌱✨ #HomeDecor #Minimalism #Design #Inspiration 2. Tuesday: Less clutter, more calm. 🕊️🏡 #HomeDecor #Minimalism #Design #Inspiration 3. Wednesday: Loving these clean lines! 🛋️🤍 #HomeDecor #Minimalism #Design #Inspiration 4. Thursday: Serenity starts at home. 🍃🙏 #HomeDecor #Minimalism #Design #Inspiration 5. Friday: Neutral tones, endless vibes. 🎨🌿 #HomeDecor #Minimalism #Design #Inspiration 6. Saturday: Minimalist bookshelf goals! 📚✨ #HomeDecor #Minimalism #Design #Inspiration 7. Sunday: Simple spaces, happy faces. 😊🏠 #HomeDecor #Minimalism #Design #Inspiration (This is the first week—let me know if you’d like week two or want ideas for specific types of minimalist spaces!)

نمونه خروجی همین پرامپت — ساخته‌شده با ChatGPT (gpt-4.1). نتیجه‌ی شما با ابزار و تنظیمات دیگر می‌تواند متفاوت باشد.

متن پرامپت

# 🚀 Instagram Auto-Post Python Bot Architect

Act as an expert Python Automation Engineer and Senior Software Architect. Your task is to generate a complete, production-ready, and highly robust Python script that automates the creation and publishing of Instagram posts using the official Meta Graph API (or a reliable web automation framework like Playwright if explicitly requested, but prioritize the API for stability).

---

### 📥 USER INPUTS / PARAMETERS

[Placeholders for the user to fill out before running]

- Niche/Topic: {TOPIC_OR_NICHE}

- Content Source: {AI_GENERATED_OR_LOCAL_FOLDER} (e.g., OpenAI GPT-4 for text + DALL-E/Midjourney for images OR pulling from a local assets folder)

- Posting Schedule: {POSTING_INTERVAL_IN_HOURS} (e.g., Every 12 hours)

- Caption Style: {CAPTION_STYLE} (e.g., Engaging, educational, emoji-rich, professional)

- Target Hashtags: {HASHTAGS_LIST}

---

### 📋 CORE REQUIRMENTS & ARCHITECTURE

The script must be clean, modular, well-commented, and include the following architectural components:

1. Environment & Credential Management:

- Use .env file for sensitive keys INSTAGRAM_BUSINESS_ACCOUNT_ID, FACEBOOK_PAGE_ACCESS_TOKEN, OPENAI_API_KEY, etc.).

- Include a template for the .env file in the comments.

2. Content Generation/Retrieval Module:

- If AI-generated: Integrate openai Python SDK to generate a highly engaging caption based on the {CAPTION_STYLE} and automatically generate/download a relevant image.

- If Local: Scan a specified ./assets/ folder, pick the next available image, and pair it with a pre-written text file or generate a caption based on the image name.

3. Instagram API Integration:

- Implement the Meta Graph API container system:

Step A: Upload image to a public URL (or use a temporary hosting workaround if running locally).

Step B: Create a media item container via POST request to /v17.0/{account_id}/media.

Step C: Publish the container via POST request to /v17.0/{account_id}/media_publish.

4. Error Handling & Logging:

- Implement robust standard logging logging module) to log success messages, API errors, and network timeouts to both the console and an automation.log file.

- Include retry logic (exponential backoff) for failed API requests.

5. Scheduler:

- Use the schedule or apscheduler library to run the script indefinitely based on the {POSTING_INTERVAL_IN_HOURS}.

---

### 🛠️ OUTPUT FORMAT

Your response must include:

1. Prerequisites: Clear pip install commands for all required libraries.

2. Configuration: The .env file structure.

3. The Python Script: A single, fully-functional, beautifully formatted .py file containing all the logic. Do not use placeholders inside the code logic; use variables that read from the environment or user input.

4. Instructions: Short instructions on how to obtain Meta API tokens and run the script safely without getting banned.

Let's build the ultimate Instagram automation tool!
نسخه‌ی پرشده که نمونه‌ی بالا با آن ساخته شد
Niche/Topic: Minimalist Home Decor
Content Source: AI_GENERATED
Posting Schedule: 12
Caption Style: Friendly, emoji-rich, short
Target Hashtags: #HomeDecor #Minimalism #Design #Inspiration

پرامپت را برای خودتان پر کنید

جاهای خالی را به فارسی پر کنید؛ پرامپت آماده‌ی کپی پایین ساخته می‌شود.

ویژه‌ی VIP: همین پرامپت را در خود سایت اجرا کنید و جواب کامل را به فارسی بگیرید. ورود به حساب

کاربرد پرامپت

این پرامپت به عنوان یک دستورالعمل جامع و مهندسی‌شده طراحی شده است تا مدل هوش مصنوعی را در نقش یک معمار ارشد نرم‌افزار و مهندس اتوماسیون پایتون قرار دهد. هدف اصلی آن، تولید یک اسکریپت کامل، آماده برای محیط عملیاتی (Production-Ready) و کاملاً ساختاریافته به زبان پایتون است که فرایند تولید و انتشار پست در اینستاگرام را به صورت ۱۰۰٪ خودکار انجام می‌دهد.

مزایا

  • تولید خودکار محتوا: قابلیت اتصال به API مدل‌های OpenAI (مانند GPT-4 و DALL-E) برای تولید هوشمندانه متن و تصویر.
  • مدیریت محتوای محلی: امکان فراخوانی تصاویر و متون از پوشه‌های داخلی سیستم (Local Folder).
  • زمان‌بندی هوشمند: زمان‌بندی انتشار پست‌ها در فواصل زمانی مشخص (مثلاً هر ۱۲ ساعت یک‌بار).
  • امنیت و مدیریت خطا: استفاده از فایل .env برای حفظ کلیدهای حساس و سیستم ثبت خطا (Logging) همراه با مکانیزم تلاش مجدد (Retry Logic).

نحوه استفاده

قبل از ارسال این پرامپت به هوش مصنوعی، باید بخش USER INPUTS / PARAMETERS را متناسب با پروژه خود تنظیم و جایگزین کنید. پارامترهای زیر باید مقداردهی شوند:

  • {TOPIC_OR_NICHE}: حوزه فعالیت یا موضوع پیج خود را بنویسید (مثلاً: Digital Marketing Tips یا Artificial Intelligence News).
  • {AI_GENERATED_OR_LOCAL_FOLDER}: منبع تامین محتوا را مشخص کنید. اگر می‌خواهید هوش مصنوعی متن و تصویر را بسازد کلمه AI_GENERATED و اگر می‌خواهید از پوشه کامپیوتر خوانده شود کلمه LOCAL_FOLDER را بنویسید.
  • {POSTING_INTERVAL_IN_HOURS}: فاصله زمانی بین هر پست به ساعت (مثلاً: 12 برای هر ۱۲ ساعت یا 24 برای روزی یک پست).
  • {CAPTION_STYLE}: لحن و سبک متن کاپشن را تعیین کنید (مثلاً: Engaging, educational, emoji-rich, friendly).
  • {HASHTAGS_LIST}: هشتگ‌های اصلی مرتبط با حوزه کاری خود را وارد کنید (مثلاً: #Python #Automation #AI #InstagramBot).

پرسش‌های متداول درباره این ویدیو

ChatGPT و Claude بهترین گزینه‌ها هستند و درک خوبی از تولید کد ماژولار پایتون دارند.

پرامپت‌های مشابه