← 返回
未分类 Key 中文

AI Instagram Auto Poster

Automate creation and direct posting of promotional images to Instagram Business accounts using Meta Graph API without third-party schedulers or paid tools.
使用 Meta Graph API 自动创建并直接发布宣传图片至 Instagram Business 账户,无需第三方排程或付费工具。
pawanshekhawat pawanshekhawat 来源
未分类 clawhub v1.0.7 1 版本 99751.2 Key: 需要
★ 0
Stars
📥 401
下载
💾 0
安装
1
版本
#ai#automation#autopost#content-generation#instagram#latest#marketing#meta-api#social-media

概述

Instagram Posting Pipeline

End-to-end Instagram automation pipeline. Generate professional promotional images and publish them automatically to any Instagram Business account — no third-party automation tools needed.

Skill Scope

  • Generate promotional images (text + branding overlays, 1080×1350)
  • Upload images to Cloudinary for public hosting
  • Publish to Instagram via Meta Graph API
  • Optional: extract business info from a public website URL

Not in scope: scraping private/internal networks, storing credentials externally, third-party data sharing.

Install Model

Instruction-driven skill — all scripts are bundled in the package. No external binaries, installers, or runtime dependencies beyond Python 3.8+ and Pillow. Place the scripts/ folder alongside the skill and configure env vars to use.

Pipeline Flow

Business info (name, details, website URL)
    → scrape_business.py (optional — auto-extract from website)
    → generate_course_promo.py
    → upload_cloudinary.py
    → post_to_instagram.py
    → Instagram post URL

Data Extraction (Optional)

scrape_business.py fetches a user-provided public URL to extract business info — name, tagline, services, contact — for auto-generating content.

What it does:

  • Makes an outbound HTTP(S) request to the provided URL
  • Parses the HTML response using Python's built-in html.parser
  • Extracts title, meta description, H1 tags, paragraphs, and contact patterns
  • Returns structured data to populate the image generation prompt
  • May extract email and phone if publicly available

What it does NOT do:

  • Does not follow redirects to third-party domains (all 3xx responses are blocked)
  • Does not access internal/private networks
  • Does not store or retransmit scraped data

> Do not provide internal/private URLs (e.g. localhost, 192.168.x.x, 10.x.x.x). SSRF protections enforced: DNS resolution + private-IP blocking (via ipaddress module), SSL certificate verification, scheme/hostname allowlist, and all redirects are explicitly blocked (no following 3xx responses to any destination).

Environment Setup

Before using, set these environment variables:

# Meta Graph API (required)
export IG_ACCESS_TOKEN="your_page_access_token"
export IG_BUSINESS_ACCOUNT_ID="your_ig_business_account_id"
export IG_DEFAULT_CAPTION="Your default caption"

# Cloudinary (required — create your own free account)
# No default credentials are used — you must set up your own
export CLOUDINARY_CLOUD_NAME="your_cloud_name"
export CLOUDINARY_UPLOAD_PRESET="your_unsigned_preset"
export CLOUDINARY_FOLDER="mybusiness"

# Image output (optional)
export IG_PIPELINE_OUTPUT_DIR="./output"

Security & Credentials

Your credentials stay yours.

  • Tokens are user-provided at runtime (environment variables)
  • Tokens are never stored externally or sent to any third-party service
  • Tokens are used only during execution and never persisted
  • SSL/TLS verification is enforced on all outbound requests
  • Use least-privilege and test accounts during evaluation
  • Never log tokens — only non-sensitive metadata is logged

Cloudinary hardening recommendation:

Prefer signed upload presets, or restrict unsigned presets by folder/origin in your Cloudinary dashboard.

Getting Credentials

Access Token:

  1. Go to https://developers.facebook.com/tools/explorer/
  2. Select your Facebook App (must have instagram_content_publish and pages_read_engagement permissions)
  3. Generate token for your Page
  4. Grant pages_read_engagement, instagram_content_publish

IG Business Account ID:

  • Found in Meta Business Suite → Instagram settings → Account ID

Step-by-Step Usage

Step 1: Generate Image

from generate_course_promo import generate_course_promo

path = generate_course_promo(
    course_name="Diploma in Artificial Intelligence",
    institution="CADDESK Centre",
    duration="90 Weeks",
    bullets=[
        "Machine Learning & Data Science",
        "Building Intelligent Systems",
        "Algorithm Development",
        "Real-World AI Projects",
    ],
    hook_lines=["Your Future in AI", "Starts Here."],
    cta_text="Ready to shape the future with AI?",
    handle="@caddeskcentre",
    output_filename="course_promo.png"
)

CLI:

python scripts/generate_course_promo.py

Step 2: Upload to Cloudinary

python scripts/upload_cloudinary.py <image_path> [folder]

Returns a public URL like https://res.cloudinary.com/image/upload/xyz.png

Step 3: Post to Instagram

python scripts/post_to_instagram.py <image_url> <caption>

Or programmatically:

from post_to_instagram import post_to_instagram

success, post_id, ig_url = post_to_instagram(
    image_url="https://res.cloudinary.com/image/upload/xyz.png",
    caption="Your caption with #hashtags"
)

Caption Structure

[HOOK - bold claim or question, 1-2 lines]
[VALUE - what they'll learn/achieve]
[CTA - link in bio / DM to enroll / visit website]
[8-15 hashtags - mix of broad + niche]

Troubleshooting

| Error | Fix |

|-------|-----|

| 401 Invalid OAuth | Token expired — regenerate at Graph API Explorer |

| IG token format error | Use Page Access Token, not IG-only token |

| image_url required | Image not publicly accessible — upload to Cloudinary first |

| 403 Forbidden | App not in Live mode or instagram_content_publish permission not approved |

| Cloudinary 400 | Image too large (>10MB), unsupported format, or credentials not configured |

| IG account not found | Account not set as Business/Creator mode in Meta |

| Scrape returns None | Website uses JS rendering — provide details manually |

Multiple Accounts

To switch between IG accounts, update environment variables before each post:

export IG_ACCESS_TOKEN="token_for_account_a"
export IG_BUSINESS_ACCOUNT_ID="ig_id_account_a"
python scripts/post_to_instagram.py <url> <caption>

版本历史

共 1 个版本

  • v1.0.7 当前
    2026-05-03 09:15 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

Marketing Mode

thesethrose
{"answer":"营销模式整合23项全能技能,涵盖策略、心理、内容、SEO、转化优化及付费增长。适用于营销策略、文案、SEO、转化优化、付费广告及各类营销战术需求。"}
★ 161 📥 24,957
content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 886 📥 203,089
content-creation

humanizer-zh

liuxy951129-cpu
去除文本中的 AI 生成痕迹。适用于编辑或审阅文本,使其听起来更自然、更像人类书写。 基于维基百科的"AI 写作特征"综合指南。检测并修复以下模式:夸大的象征意义、 宣传性语言、以 -ing 结尾的肤浅分析、模糊的归因、破折号过度使用、三段
★ 56 📥 28,346