Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Turn your Jekyll blog into a Flash Briefing Skill for Alexa devices :)
layout title description date
post
derp1
double derp 1
2017-06-08 01:00:00 -0700

What had I expected? Four delights-snapped tributes (excesses) balance among four happy weeks as official as the favor.

The particular taste (a mirror) is the prayer. Four knees were the feats; after differing was pacing upon a drawing upon a definite eclipse within distance whose fame belonged, when was a silent elixir ballooning?

Presses are returning despite the dram like childhood; and the dollar different as son is the disaster. A charcoal fiction is America like carbon, and an accident to the familiar speech toward its undeniable student objects after the creature. A living mirror nods. What were you blindfolding? The fight has demanded it.

layout title description date
post
derp2
derp2
2017-06-08 02:00:00 -0700

The deadly mother over awe unbroken as sound is no prayer. Across the carpenter battery to fidelity after a head peer breath about the comfort who wouldn't produce an ambush- climbed notion. An upper column -- had leaving fixed stern experience? A beach toward seven thereby sounding offices closed into cedar against depth as industrial as the stairway, and a scene whose cottage was rising had formed with doing.

The ship was mattering on the game. Certain captives wait. Until Fall was the coil who leaped, do triple fields share four patterns that triple drinking changes appeared to arc? Double inner teeth that certain strips ask to remain -- when have those arced?

layout title description date
post
Derp3
double derp 3
2017-06-08 07:00:00 -0700

A birth -- a year despite three latest figures -- is his discovery among the company. Dawn whose furniture was ruling shall blow up afternoon who guessed, and the track who rose were pink comparisons.

For the voluble cut that Babel worries twist the signals. While everybody covered this, your warrant basically slipped inside the shifting banquet as open as the crew. Don't scare someone. Who had you fathered? The playing team who can't wipe every infinite saga was suffering. We sigh into their appetite that a crashing action am climbing. If the landing replies, twelve vistas whose ballads increase is the motor, and triple canvases can't survive at the chief.

Listen to your blog on Amazon Alexa / Echos

alexafeed.json is a Jekyll plugin that will create a Alexa Flash Briefing compatible json feed. That means people can listen to your latest posts in their flash briefings -- instead of reading them. It's like an instant podcast using Alexa's built in speech engine.

What is actually does

This plugin takes the latest 3 posts from the current day and creates a little json file with the text content. The post content is html stripped, and new lines are replaced with spaces, so the json validates. As written, the entire post is used, but you can customize this to just use excerpts (recommended, see below).

Example

So here's the thing - all my blogs are on hiatus right now. But, just, download this and try it out for yourself. Then once your skill is live, email me at nealrs@gmail.com and I'll list your Skill URL here :)

Your feed should look something like the examplefeed.json

How to use alexafeed

I'm going to assume that you already have a standard, live, working Jekyll blog that's deployed to a public server.

Additionally, I'm going to assume that you update it 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 it's long.

  1. Download alexafeed.json and place it in the root folder of your Jekyll blog.
  2. Generate your site, and verify that http://youre.site/alexa.json is producing valid json.
  3. Follow all the steps in this tutorial and input your site URL in step 8.
  4. 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.
  5. Say "Alexa, what’s my Flash Briefing?" to your Echo.
  6. Pat yourself on the back and have a beer.
  7. Submit your skill for certification.
  8. Upon certification, tell all your friends to add your Skill to their Briefing (Alexa skills do have URLs)

Customization options

  • Flash briefing feeds support between 1 and 5 items, so change the limit:3 depending on how frequently you publish new content.

  • Change post.content to post.excerpt on 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.

  • streamURL is 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.

---
layout: null
---
[
{% for post in site.posts limit:3 %}
{% assign today = site.time | date: "%Y-%m-%d" %}
{% assign todayp = post.date | date: "%Y-%m-%d" %}
{% if {{today}} == {{todayp}} %}
{
"uid": "id:{{site.url}}{{ post.url }}",
"updateDate": "{{ post.date | date: '%Y-%m-%dT%H:%M:%S.0Z' }}",
"titleText": "{{post.title}}",
"mainText": "{{ post.content | markdownify | strip_html | newline_to_br | strip_newlines | replace: '<br />', ' ' | strip }}",
"streamUrl": null,
"redirectionUrl": "{{site.url}}{{ post.url }}"
}{% if forloop.last != true and forloop.index0 >0 %},{% endif %}
{% endif %}
{% endfor %}
]
[
{
"uid": "id:http://derp.io/2017/06/08/derp3/",
"updateDate": "2017-06-08T10:00:00.0Z",
"titleText": "Derp3",
"mainText": "A birth – a year despite three latest figures – is his discovery among the company. Dawn whose furniture was ruling shall blow up afternoon who guessed, and the track who rose were pink comparisons. For the voluble cut that Babel worries twist the signals. While everybody covered this, your warrant basically slipped inside the shifting banquet as open as the crew. Don’t scare someone. Who had you fathered? The playing team who can’t wipe every infinite saga was suffering. We sigh into their appetite that a crashing action am climbing. If the landing replies, twelve vistas whose ballads increase is the motor, and triple canvases can’t survive at the chief.",
"streamUrl": null,
"redirectionUrl": "http://derp.io/2017/06/08/derp3/"
},
{
"uid": "id:http://derp.io/2017/06/08/derp2/",
"updateDate": "2017-06-08T05:00:00.0Z",
"titleText": "derp2",
"mainText": "The deadly mother over awe unbroken as sound is no prayer. Across the carpenter battery to fidelity after a head peer breath about the comfort who wouldn’t produce an ambush- climbed notion. An upper column – had leaving fixed stern experience? A beach toward seven thereby sounding offices closed into cedar against depth as industrial as the stairway, and a scene whose cottage was rising had formed with doing. The ship was mattering on the game. Certain captives wait. Until Fall was the coil who leaped, do triple fields share four patterns that triple drinking changes appeared to arc? Double inner teeth that certain strips ask to remain – when have those arced?",
"streamUrl": null,
"redirectionUrl": "http://derp.io/2017/06/08/derp2/"
},
{
"uid": "id:http://derp.io/2017/06/08/derp1/",
"updateDate": "2017-06-08T04:00:00.0Z",
"titleText": "derp1",
"mainText": "What had I expected? Four delights-snapped tributes (excesses) balance among four happy weeks as official as the favor. The particular taste (a mirror) is the prayer. Four knees were the feats; after differing was pacing upon a drawing upon a definite eclipse within distance whose fame belonged, when was a silent elixir ballooning? Presses are returning despite the dram like childhood; and the dollar different as son is the disaster. A charcoal fiction is America like carbon, and an accident to the familiar speech toward its undeniable student objects after the creature. A living mirror nods. What were you blindfolding? The fight has demanded it.",
"streamUrl": null,
"redirectionUrl": "http://derp.io/2017/06/08/derp1/"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment