Home
Automated Blog Content Pipeline
A content generation and scheduling pipeline has been implemented to automate the creation of blog posts for "The Shopper's Guide".
Overview
The system uses a blog_ideas table as a work queue for a Python script (content_worker.py) that leverages the Gemini 2.5 Flash API to write and schedule articles.
Workflow
- Ideation: New blog post ideas are added to the
blog_ideastable with apendingorapprovedstatus. This is the starting point for the entire pipeline. - Automation: The
content_worker.pyscript is run. It fetches allapprovedideas from the database. - Content Generation: For each idea, the script generates a detailed prompt and uses the Gemini API to write the blog post content as HTML.
- Scheduling: The newly generated post is saved to the
blog_poststable with ascheduledstatus and ascheduled_fortimestamp. The script automatically schedules one post per day to ensure consistent engagement. - State Update: The original idea in the
blog_ideastable is updated todraftedand linked to the new post to prevent re-generation.
How to Use
-
Add a New Idea: To add a new topic to the content queue, insert a row into the
blog_ideastable. Set thestatusto'approved'to have the worker pick it up on its next run.-- Example: INSERT INTO blog_ideas (topic, category_id, suggested_products, status, notes) VALUES ( 'The Ultimate Guide to Smart Home Security', (SELECT id FROM blog_categories WHERE slug = 'tech-innovation'), '["Smart Doorbell", "Indoor Security Camera", "Smart Locks"]', 'approved', 'Focus on ease of installation and privacy features.' ); -
Run the Content Worker: Execute the script from the
/var/www/directory. Ensure yourGEMINI_API_KEYis set in the.envfile.# Navigate to the script's location cd /var/www/Fulfilora # Run the script using its virtual environment ./content_worker_venv/bin/python ./content_worker.py