📑 Table des matières

Automatiser ses réseaux sociaux avec l'IA

Productivité IA 🟡 Intermédiaire ⏱️ 15 min de lecture 📅 2026-02-24

Publishing content on social media is a full-time job. Writing posts, adapting the format for each platform, creating visuals, scheduling publications, analyzing performance... And starting all over again the next day.

What if AI did 80% of the work for you?

In this guide, we explore how to automate your social media presence with artificial intelligence — from content generation to publication, and data-driven optimization.

🎯 Why Automate Your Social Media?

Before diving into the how, let's look at the why:

Task Manual Time (per week) With AI Gain
Writing posts (5/week) 5h 30min (review) 90%
Creating visuals 3h 20min (prompts) 89%
Multi-platform adaptation 2h 5min (auto) 96%
Scheduling 1h 0min (auto) 100%
Performance analysis 2h 10min (reading report) 92%
Total 13h ~1h 92%

13 hours per week recovered. That's almost 2 working days that you can reinvest in your main activity.

What AI Does Well

  • ✅ Generate text variants quickly
  • ✅ Adapt tone and format per platform
  • ✅ Create visuals from descriptions
  • ✅ Analyze patterns in data
  • ✅ Schedule and publish automatically
  • ✅ Test variants (A/B testing)

What AI Doesn't (Yet) Do Well

  • ❌ Replace your authentic voice (it imitates it)
  • ❌ Manage communication crises
  • ❌ Create genuine human relationships
  • ❌ Understand subtle cultural nuances
  • ❌ Respond to DMs with real empathy

The right approach: AI generates, you validate and humanize.

✍️ Text Content Generation

AI Content Strategy

AI can plan your complete editorial calendar:

Prompt: "Create an editorial calendar for a LinkedIn account
on AI and productivity. 5 posts per week for 1 month.
Alternate between: practical tips, storytelling, educational carousels,
engagement questions, resource sharing."

Typical result:

## Week 1 - Theme: "AI in Daily Life"

| Day | Type | Topic | Hook |
|------|------|-------|------|
| Monday | Tip | 5 ChatGPT prompts to save 1h/day | "I saved 5h this week with 5 prompts..." |
| Tuesday | Story | How I automated my emails | "3 months ago, I spent 2h/day on emails..." |
| Wednesday | Carousel | 7 essential free AI tools | "Stop paying for AI tools 🧵" |
| Thursday | Question | Which AI tool changed your workflow? | "If you had to keep only ONE AI tool..." |
| Friday | Resource | Complete prompt engineering guide | "The document that changed my AI usage ↓" |

Writing with Persona

To make AI write with your voice, give it context:

import anthropic

client = anthropic.Anthropic()

# Define your persona
PERSONA = """
You are [Name]'s ghostwriter. Your style:
- Short and impactful sentences
- Many line breaks (LinkedIn format)
- Always start with a provocative hook
- Use emojis sparingly (max 3 per post)
- Address the reader directly
- End with a CTA or question
- Tone: expert but accessible, never condescending

Examples of successful posts:
[Paste 3-5 of your best posts here]
"""

def generate_post(topic: str, platform: str = "linkedin") -> str:
    response = client.messages.create(
        model="claude-sonnet-4-20250514",
        max_tokens=1000,
        system=PERSONA,
        messages=[{
            "role": "user",
            "content": f"Write a {platform} post on: {topic}"
        }]
    )
    return response.content[0].text

Batch Generation

To produce all content for the week at once:

import json
from datetime import datetime, timedelta

def generate_weekly_content(topics: list, platforms: list) -> dict:
    """Generate content for a complete week."""
    content = {}

    for i, topic in enumerate(topics):
        day = datetime.now() + timedelta(days=i)
        day_key = day.strftime("%Y-%m-%d")
        content[day_key] = {}

        for platform in platforms:
            post = generate_post(topic, platform)
            content[day_key][platform] = {
                "text": post,
                "topic": topic,
                "status": "draft",
                "scheduled": False
            }

    return content

# Usage
topics = [
    "5 AI prompts to save time",
    "My automation workflow",
    "Beginner's mistakes with AI",
    "AI tool of the week: Cursor",
    "Monthly review and numbers"
]

platforms = ["linkedin", "twitter", "instagram"]
weekly = generate_weekly_content(topics, platforms)

# Save
with open("content_week.json", "w") as f:
    json.dump(weekly, f, indent=2, ensure_ascii=False)

🎨 Visual Generation

Images with AI

For post visuals, several options:

Tool Type Quality Cost API
DALL-E 3 Generation ⭐⭐⭐⭐ ~0.04$/image
Midjourney Generation ⭐⭐⭐⭐⭐ 10$/month ⚠️
Stable Diffusion Generation ⭐⭐⭐⭐ Free (self-hosted)
Canva AI Editing + AI ⭐⭐⭐⭐ 12$/month
Leonardo AI Generation ⭐⭐⭐⭐ Freemium

Automating Visual Creation

from openai import OpenAI

client = OpenAI()

def generate_social_image(
    topic: str,
    platform: str = "instagram",
    style: str = "modern, minimalist, tech"
) -> str:
    """Generate an image optimized for a platform."""

    # Dimensions per platform
    sizes = {
        "instagram": "1024x1024",  # Square
        "linkedin": "1792x1024",   # Landscape
        "twitter": "1792x1024",    # Landscape
        "youtube": "1792x1024",    # Thumbnail
        "story": "1024x1792",      # Portrait (stories)
    }

    size = sizes.get(platform, "1024x1024")

    response = client.images.generate(
        model="dall-e-3",
        prompt=f"""Create a social media visual for {platform}.
        Topic: {topic}
        Style: {style}
        Requirements:
        - No text in the image (text will be added as overlay)
        - Clean, professional look
        - Good contrast for readability
        - Brand colors: blue (#3B82F6) and white""",
        size=size,
        quality="hd",
        n=1
    )

    return response.data[0].url

Short Videos with AI

Reels, Shorts, and TikToks dominate engagement. AI can help:

# Example of automated video pipeline

def create_short_video(script: str, style: str = "talking_head"):
    """Pipeline to create a short video."""

    steps = {
        "1_script": "Generate/refine script with Claude",
        "2_voiceover": "Text-to-speech (ElevenLabs, OpenAI TTS)",
        "3_visuals": "B-roll or AI avatar (HeyGen, Synthesia)",
        "4_captions": "Auto captions (Whisper)",
        "5_editing": "Auto editing (FFmpeg, Remotion)",
        "6_thumbnail": "AI thumbnail (DALL-E)",
    }

    return steps

Recommended tools for AI video:

Step Tool Description
Script Claude / GPT-4 Script writing
Voiceover ElevenLabs Natural French voices
Avatar HeyGen / Synthesia AI presenter
Captions Whisper (OpenAI) Automatic transcription
Editing FFmpeg + Python Automated editing
Thumbnail DALL-E 3 Attractive thumbnails

📱 Platform Adaptation

Each social network has its own codes. AI can automatically adapt the same content for each platform.

Key differences

Criteria LinkedIn Twitter/X Instagram YouTube TikTok
Length 1300 chars 280 chars 2200 chars Free description 300 chars
Tone Pro, expert Concise, punchy Visual, lifestyle Educational, detailed Fun, casual
Hashtags 3-5 2-3 15-30 5-10 (tags) 4-6
Format Long text Thread or tweet Carousel/Reel Long video Short video
Hook Story/stat Provocative Strong visual Thumbnail First 3 sec.
CTA "Comment" "RT if..." "Save 📌" "Subscribe" "Follow for +"

Automatic adaptation function

def adapt_content(original_text: str, source: str, target: str) -> str:
    """Adapt content from one platform to another."""

    platform_guidelines = {
        "linkedin": {
            "max_chars": 1300,
            "tone": "professional but accessible",
            "format": "short paragraphs, frequent line breaks",
            "hashtags": "3-5, at the end",
            "cta": "open question or invitation to comment"
        },
        "twitter": {
            "max_chars": 280,
            "tone": "concise, impactful, slightly provocative",
            "format": "single tweet or 3-5 tweet thread",
            "hashtags": "2-3 max, naturally integrated",
            "cta": "RT, like, or simple question"
        },
        "instagram": {
            "max_chars": 2200,
            "tone": "inspiring, personal, storytelling",
            "format": "story with paragraphs, emojis at line start",
            "hashtags": "20-30, in a separate comment",
            "cta": "save, share in story, link in bio"
        },
        "youtube": {
            "max_chars": 5000,
            "tone": "educational, structured, enthusiastic",
            "format": "timestamps, clear sections",
            "hashtags": "5-10 relevant tags",
            "cta": "subscribe, bell, comment"
        },
        "tiktok": {
            "max_chars": 300,
            "tone": "fun, direct, GenZ-friendly",
            "format": "ultra short, immediate hook",
            "hashtags": "4-6, including trends",
            "cta": "follow for more, comment your opinion"
        }
    }

    target_rules = platform_guidelines[target]

    prompt = f"""Adapt this {source} content for {target}.

Original content:
{original_text}

Rules for {target}:
- Max {target_rules['max_chars']} characters
- Tone: {target_rules['tone']}
- Format: {target_rules['format']}
- Hashtags: {target_rules['hashtags']}
- CTA: {target_rules['cta']}

Adapt both content AND form. Don't just shorten or copy-paste."""

    response = client.messages.create(
        model="claude-sonnet-4-20250514",
        max_tokens=1500,
        messages=[{"role": "user", "content": prompt}]
    )

    return response.content[0].text


# Example usage
linkedin_post = """I've automated 80% of my social media management.

Result? 13h/week recovered.

Here's how I did it (thread) 🧵..."""

# Adapt for all platforms
for platform in ["twitter", "instagram", "tiktok"]:
    adapted = adapt_content(linkedin_post, "linkedin", platform)
    print(f"\n--- {platform.upper()} ---")
    print(adapted)

YouTube: optimizing tags and descriptions

def optimize_youtube_metadata(video_topic: str, transcript: str) -> dict:
    """Generate SEO-optimized title, description, tags for YouTube."""

    prompt = f"""For a YouTube video on: {video_topic}

Transcript (summary): {transcript[:2000]}

Generate:
1. 5 catchy titles (with SEO keywords)
2. Complete description (with fictional timestamps, links, CTA)
3. 30 relevant tags (from most specific to most general)
4. 3 thumbnail ideas

JSON format."""

    response = client.messages.create(
        model="claude-sonnet-4-20250514",
        max_tokens=2000,
        messages=[{"role": "user", "content": prompt}]
    )

    return json.loads(response.content[0].text)

Instagram: strategic hashtags

# (The original code was not fully translated as it was cut off)