First published in 1975, the Oblique Strategies are a collection of brief aphorisms meant to stimulate creativity. Such as “Give way to your worst impulse,” “Question the heroic approach,” and “Work at a different speed.”
This project builds an Amazon Alexa skill around the Oblique Strategy API provided by Andrew Monks.
Let's get started:
$ npm install -g yo generator-alexa-skill
$ mkdir chuck-norris-alexa-skill
$ cd !$
$ yo alexa-skill
This generates a skeleton Alexa skill, with npm scripts for running tests, packaging and deploying to AWS Lambda.
Implementing the API calls is just a simple JavaScript fetch and JSON parse:
function getStrategy() {
return fetch(ApiEndpoint).then(_ => _.json()).then(strategy => {
const isBlank = strategy.strategy === '[blank white card]';
return isBlank ? getStrategy() : strategy;
});
}
To package the skill for AWS Lambda, we just run:
$ npm run deploy
Comments