As a feature of your blog, having an Alexa Skill as a reader for your blog is a great idea. It allows folks to enjoy your blog while not sitting at a computer or holding a phone or tablet. Sounds great right? One small problem, Alexa has an 8000 character limit on any given response she provides. If your blog posts are fairly short, not really a problem, but then your blog posts are more like tweets.
So how does one get around this 8000 character limit?
Audio.
Huh?, you may ask. Am I supposed to read each blog post and record it? Well, you could, and essentially convert your blog to a pod cast.
Gee, that sounds like a lot of work.
I’m not comfortable being on mic.
No problem. To solve these problems we can use Alexa and something else in the AWS arsenal, Polly.
AWS Polly is a service on AWS that converts text to speech. It offers a number of voices to choose from, so you can pick on that matches your branding. The service takes a body of text and converts it to an audio recording in MP3 format, perfect for podcasting.
Okay, so how does all of this work?
The system is split into two parts, and is based on a WordPress installation that isn’t on a server you can easily move files on and off of. If you have full control of your server, this solution can be condensed onto a single server with a modified php page and an S3 Bucket.
Above the dotted line is the Alexa Skill and it’s companion Lambda function. The skill works as any other podcast skill, and blog posts can be presented in any manner you choose. Since you lat tuned in, most recent, etc. The skill streams the podcast files from the S3 bucket.
Below the dotted line is the script side of things. This keeps the podcast up to date and in sync with the blog.
A php script file is cued to run on a regular basis, every hour or whatever schedule you like. This script:
- Reads the RRS feed from the blog
- Checks the database to see if the entry exists
- Adds an entry if it doesn’t
- Sends the copy (text) of the blog post to Polly
- Polly converts the text to a spoken MP3 file on the server
- The MP3 file is then moved off the server to the S3 bucket for streaming by Alexa
Once all of this is in place, the first run of the script may take a while to complete, depending on how many previous blog post there are. After that, most time will be fairly short and only need a moment to run when a new post is published.
Additional housekeeping can include removing episodes (posts) if deleted from the blog.
And that is basically it. If you’d like to deploy this solution for your blog, you can contact me here for more details and pricing.