Visit the Podcast HERE
How It Works: The Automated Podcast & Video Workflow
This system is a powerful, two-part engine designed to transform raw data into polished, ready-to-publish media. Part one is a custom WordPress plugin (PHP) that handles scheduling, audio generation, and post creation. Part two is a Python script that takes over to produce promotional graphics and videos automatically.
Part 1: The WordPress Engine (From Text to Podcast Post)
This is the central hub where each episode begins its life. It’s a guided, step-by-step process built directly into the WordPress dashboard.
Step 1: Automated Scheduling
The process starts with our database of US legislators. To ensure a consistent content pipeline, the system automatically maintains a queue of 20 upcoming episodes.
- The script checks how many legislators are scheduled for a future date.
- If the queue has fewer than 20, it randomly selects new legislators who haven’t been covered yet.
- It assigns each one a publication date, creating a hands-off, rolling content calendar.
Step 2: AI-Powered Audio Generation
Once a legislator is selected from the schedule, we create the audio using Google’s advanced Text-to-Speech technology.
- A script is written or pasted into a text editor within WordPress.
- Special tags like
<voice name="...">can be used to assign different AI voices and speaking styles to various parts of the script, creating a dynamic, conversational feel. - The system intelligently splits the script into optimized chunks and sends them to the Google Cloud TTS API.
- Google’s API returns incredibly human-like MP3 audio segments for each chunk.
Step 3: Assembling the Final Episode
After all the audio segments are generated, the system presents them for a final review.
- The user can listen to each individual audio file to ensure quality.
- With a single click on “Merge Selected Files,” the script seamlessly combines the segments into one complete, final MP3 file for the episode.
Step 4: Creating the WordPress Post
This is the final stage within WordPress, where all the elements are brought together.
- The show notes and a summary are added to the post content.
- A list of image URLs is pasted into a “Video Images” field. These images are the visual foundation for the video slideshow created later.
- The script automatically pulls the legislator’s details (name, party, state, social media links) from the database to create a rich, informative post.
- It then creates a new podcast post, attaches the merged MP3, sets the tags, and fetches a high-quality featured image from Wikipedia using the legislator’s profile.
- The post is saved as “Pending” and is now ready for the next phase.
Part 2: The Video Factory (From Post to Social Videos)
This Python script runs locally and acts as an automated media producer. It constantly watches the WordPress site for new episodes that are ready for video creation.
Step 5: Finding the Next Project
The Python script securely connects to the WordPress site using the REST API. Its first job is to find work.
- It automatically searches for the latest podcast post that is set to “Pending” and has been marked as “Ready for Video.”
Step 6: Gathering All the Assets
Once it finds a post, the script gets to work downloading all the necessary components into a local project folder.
- It downloads the final MP3 audio file.
- It downloads the post’s featured image.
- It downloads every image from the list of URLs provided back in Step 4.
Step 7: Auto-Generating Social Graphics
Before making the video, the script first creates a set of professional, custom-branded graphics for promotion.
- Using the legislator’s featured image and data, it programmatically generates multiple images.
- These include a wide YouTube thumbnail, a square graphic for Facebook/Instagram, and other variations.
- It then uploads these newly created graphics back to the WordPress Media Library and links them to the post.
Step 8: Building the Final Videos
This is the grand finale. The script combines the audio and images into polished videos.
- It uses the downloaded MP3 as the complete audio track.
- It creates a dynamic slideshow from the images downloaded in Step 6, automatically timing each image to display for an equal amount of time, ensuring the slideshow’s duration perfectly matches the audio length.
- The script outputs two final video files, optimized for the most popular platforms:
- A widescreen 16:9 MP4 video for YouTube.
- A vertical 9:16 MP4 video for TikTok, YouTube Shorts, and Reels.
This end-to-end automated workflow ensures a consistent, high-quality, and efficient production of both audio podcasts and their accompanying video versions, ready for publication across all major platforms.
