Turn your blog into a podcast06.14.17 · json alexa
Git@Me is still on hiatus, but I really wanted to publish this post. And yeah, I try not to blog about stuff I make, but I think you’ll want to try this out.
This week’s hack combines three things: blogs, podcasts, and Amazon Alexa. Why? Well, blogs have become passé, podcasting is having a moment, and Alexa’s Flash Briefing feature is first class feature for distributing your content.
The best Flash Briefing skills, like NPR, use prerecorded audio, but the API supports text-to-speech too, so you have Alexa read your latest posts to you every time you invoke the flash briefing. Basically, it’s an instant podcast. Pretty neat, right?
My alexafeed.json Jekyll plugin creates a Alexa Flash Briefing compatible json feed. It uses the latest 3 posts from the current day and puts them in the correct JSON format. It strips HTML and new lines, so the JSON validates. By default, it includes the entire post, but you can customize it to just use excerpts – which I recommend.
There are a few prerequisites:
You already have a standard, live, working Jekyll blog that’s deployed to a public server.
You update your blog at least daily. If not, your content will get stale quickly and nobody wants to hear the same story over and over in their briefing, especially if you write long posts.
Get it up and running:
- Download alexafeed.json and place it in the root folder of your Jekyll blog.
- Generate your site, and verify that http://your.site/alexa.json is producing valid JSON.
- Follow all the steps in this tutorial and input your site URL in step 8.
- Enable your skill by opening the Alexa app on your phone, navigating to the Skills tab, clicking Your Skills, and selecting your Flash Briefing Skill.
- Say “Alexa, what’s my Flash Briefing?” to your Echo.
- Pat yourself on the back and have a beer.
- Submit your skill for certification.
- Upon certification, tell all your friends to add your Skill to their Briefing (Alexa skills do have URLs)
FYI! Alexa does offer some play and subscriber metrics, so you can track how well you’re marketing efforts are working. Metrics for Flash Briefing skills are new and way better than anything Apple ever offered podcasters.
There are a few customization options & notes:
Flash briefing feeds support between 1 and 5 items, so change the
limit:3depending on how frequently you publish new content.
post.excerpton line 12 if you don’t want Alexa to read out your entire post. Excerpts cut content at the first
\n\n. I’d actually recommend doing this if your posts exceed 500 words.
streamURLis set as null, because as designed, this is a text-to-speech feed, unlike the NPR feeds which are audio driven. If you want to instead use audio, you’ll need to host audio, include a filename pointer in your post markdown, and change the briefing type of your skill.
I’m not totally sure how to deal with special characters / escaping html entities in a bullet proof format - but Alexa will try to read them / does a pretty good job.