Youtube_SEO_Content_Generator / seo_optimizer.py
ANASAKHTAR's picture
Create seo_optimizer.py
e3b75a7 verified
raw
history blame
586 Bytes
import re
def optimize_content(content: str):
"""Optimize the generated content for SEO."""
# Example: Simple SEO enhancements (can be customized for more complex logic)
title = "SEO Optimized Title: " + content[:60] + "..."
description = "SEO Optimized Description: " + content[:150] + "..."
tags = re.findall(r'\b\w+\b', content.lower())[:10] # Extract the first 10 words as tags
return {
"content": content,
"metadata": {
"title": title,
"description": description,
"tags": tags
}
}