DEV Community

roberto degani
roberto degani

Posted on

How I Automated My Content Pipeline with AI — From Idea to Published Post

Content creation is one of the most time-consuming aspects of digital marketing. I was tired of spending hours writing and editing articles, so I built an automated content pipeline that combines AI-powered generation with intelligent analysis.

The Problem

My typical content workflow took 2-4 hours per article:

  • Brainstorming and outlining (30-60 min)
  • Writing 2000+ words (45-90 min)
  • Self-editing (30 min)
  • Checking readability and tone (20 min)
  • Final polish (15 min)

With 2-3 articles per week, I was losing 8-12 hours weekly.

The Solution: Two APIs Working Together

The pipeline combines:

Architecture

User Input (Topic/Keywords)
         ↓
AI Content Generator API (Initial Draft)
         ↓
AI Text Analyzer API (Sentiment, Readability, Keywords)
         ↓
Analysis-Based Refinement Logic
         ↓
Final Content Output (HTML/Markdown)
Enter fullscreen mode Exit fullscreen mode

Step 1: API Client Setup

// config.js
import axios from 'axios';
import dotenv from 'dotenv';
dotenv.config();

export const generatorClient = axios.create({
  baseURL: 'https://ai-content-generator.p.rapidapi.com',
  headers: {
    'X-RapidAPI-Key': process.env.RAPIDAPI_KEY,
    'X-RapidAPI-Host': 'ai-content-generator.p.rapidapi.com'
  }
});

export const analyzerClient = axios.create({
  baseURL: 'https://ai-text-analyzer.p.rapidapi.com',
  headers: {
    'X-RapidAPI-Key': process.env.RAPIDAPI_KEY,
    'X-RapidAPI-Host': 'ai-text-analyzer.p.rapidapi.com'
  }
});
Enter fullscreen mode Exit fullscreen mode

Step 2: Content Generation

export async function generateContent(topic, keywords, style = 'professional') {
  const response = await generatorClient.post('/generate', {
    topic, keywords, style,
    length: 'long',
    format: 'markdown'
  });
  return {
    content: response.data.generated_text,
    wordCount: response.data.word_count
  };
}
Enter fullscreen mode Exit fullscreen mode

Step 3: Content Analysis

export async function analyzeContent(text) {
  const response = await analyzerClient.post('/analyze', {
    text,
    analyses: ['sentiment', 'readability', 'keywords', 'tone']
  });
  return {
    sentiment: response.data.sentiment,
    readabilityScore: response.data.readability_score,
    keywords: response.data.keywords,
    tone: response.data.tone
  };
}
Enter fullscreen mode Exit fullscreen mode

Step 4: The Pipeline Orchestrator

export async function runContentPipeline(topic, keywords) {
  console.log('📝 Generating content...');
  const { content, wordCount } = await generateContent(topic, keywords);
  console.log(\`✓ Generated \${wordCount} words\`);

  console.log('🔍 Analyzing quality...');
  const analysis = await analyzeContent(content);
  console.log(\`Readability: \${analysis.readabilityScore}/100\`);
  console.log(\`Sentiment: \${analysis.sentiment}\`);
  console.log(\`Tone: \${analysis.tone}\`);

  // Format with frontmatter
  const tags = analysis.keywords.slice(0, 5);
  const output = \`---
title: "\${topic}"
tags: [\${tags.map(k => \`"\${k}"\`).join(', ')}]
---
\${content}\`;

  return { content: output, analysis, wordCount };
}
Enter fullscreen mode Exit fullscreen mode

Real-World Results

Metric Before After
Time per article 2-4 hours 15-20 min
Monthly output 8-12 articles 40-50 articles
Readability score 55/100 68/100
SEO keywords/article 8-10 15-20

Batch Processing

async function generateBatch(topics) {
  return Promise.all(
    topics.map(t => runContentPipeline(t, t.toLowerCase().split(' ')))
  );
}

const batch = await generateBatch([
  "API Security Best Practices",
  "Microservices Architecture Patterns",
  "Real-time Data Processing"
]);
Enter fullscreen mode Exit fullscreen mode

Getting Started

  1. Sign up at RapidAPI
  2. Subscribe to AI Content Generator
  3. Subscribe to AI Text Analyzer
  4. Start with the Free tier (100 requests/month)

Each article requires ~2-3 API calls. The Pro plan ($9.99/mo) gives you unlimited access for serious content production.

By automating content creation with AI, you're not replacing creativity — you're amplifying it. These tools handle the mechanical aspects while you focus on strategy and quality control.


What tools do you use for content automation? Share in the comments!

Top comments (0)