ContentGen-AI
Topic queue in, publish-ready articles out.
Python toolkit that automates SEO-optimized blog and affiliate article generation end to end with the OpenAI API.
Topic queue in, publish-ready articles out.
Python toolkit that automates SEO-optimized blog and affiliate article generation end to end with the OpenAI API.
I run a few small AI-generated niche blogs (galena.es and ondahertz.es) and the bottleneck was never ideas, it was the repetitive labor between an idea and a published post: writing the draft, generating an image, naming files, dropping them in the right folder, and pinging search engines. ContentGen-AI exists to remove that labor so I can run several sites without it becoming a second job.
The pipeline is driven by a CSV queue. The generator reads the next topic, and if the queue is empty it asks OpenAI for fresh ones and writes them back to the CSV. I chose CSV files over a database deliberately: the workload is a simple ordered queue, CSV is trivial to inspect and hand-edit, and it keeps the toolkit dependency-light and portable.
Each item flows through content generation, then a DALL-E image plus AI-written alt text, then a Markdown file saved into a category-based path. The same script handles two content shapes, standard blog posts and affiliate products, by branching the prompts rather than maintaining two codebases.
For reliability I leaned on observability over cleverness. Telegram notifications report progress and errors at every stage, and bad topics get logged and moved to an error CSV instead of stopping the run. After publishing, the script pings IndexNow endpoints so new articles get crawled fast. Everything site-specific lives in environment variables and a shared config.py, so pointing the toolkit at a new blog is a config change, not a fork.
python AI_scripts/generate_article.py