Skip to content

metimol/blog_generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advanced AI Blog Generator with GPT-4o

An advanced Python application that generates comprehensive, structured blog posts using OpenAI's GPT-4o model. This project goes far beyond a basic text generator by creating complete blog posts with proper structure, SEO optimization, and image prompts.

Features

  • Intelligent Blog Structure Planning: Automatically generates a complete blog outline with appropriate sections
  • SEO Optimization: Includes keyword generation and meta descriptions
  • Multi-Section Generation: Creates cohesive content across all blog sections
  • Custom User Preferences: Customize target audience and writing tone
  • Image Prompt Suggestions: Generates AI image prompts to complement your blog
  • Export Options: Saves blogs as Markdown and HTML files with proper formatting
  • Rich Console Interface: Visually appealing CLI experience with progress indicators

Installation

  1. Clone this repository:

    git clone https://github.com/metimol/blog_generator.git
    cd blog_generator
    
  2. Install the required packages:

    pip install -r requirements.txt
    
  3. Create a .env file in the project directory and add your OpenAI API key:

    OPENAI_API_KEY=your_openai_api_key_here
    

Usage

Run the program with:

python blog_generator.py

Optional arguments:

  • --model: Specify a different OpenAI model (default is "gpt-4o")
    python blog_generator.py --model gpt-3.5-turbo
    

How It Works

  1. Blog Structure Planning:

    • The program first generates a comprehensive blog structure based on your topic
    • Creates a title, sections with descriptions, and SEO keywords
  2. User Customization:

    • Select your target audience and writing tone
    • Review and confirm the blog structure before proceeding
  3. Content Generation:

    • The program generates detailed content for each section
    • Ensures cohesion between sections and appropriate transitions
    • Creates a complete blog with proper Markdown formatting
  4. Image Suggestions:

    • Generates image prompts that complement your blog content
    • Includes suggested image styles and section placement
  5. Export Options:

    • Saves the blog as both Markdown and HTML
    • Includes proper metadata and styling

Technical Details

The Advanced Blog Generator uses OpenAI's GPT-4o model to generate all content. The program includes:

  • Proper API error handling and retry logic
  • JSON parsing for structured content
  • Rich console interface with progress indicators
  • Clean file exports with metadata

System Requirements

  • Python 3.7 or higher
  • An OpenAI API key with access to the GPT-4o model
  • Internet connectivity for API access

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

  • OpenAI for providing the GPT-4o API
  • The Rich library for the beautiful console interface