|Software apps and online services:|
Coloring books for grown-ups are a growing trend. Usually, they are meant for kids, but now there are a lot of adults that seek the calmness and zen moment a coloring session can bring.
My wife is, at the moment of the writing, 31 weeks pregnant. We have two more children and she is also studying a Master degree. So she gets a bit stressed at times. When that happens she likes to color. Looking for something to color on internet can easily spoil the moment when you are trying to relax and relieve some stress. That's when we thought that Alexa could help us to just print something. No computer, no tablet, no phone, easy and fast.
You can find the Alexa Skill in the Amazon Alexa Skills store:
You'll need to link you Google Account and have a printer associated with it.
Now I'll walk you through the process of installing this skill on your own infrastructure.
API KEY and OAuth Client ID
You'll need a Google Developers account. At the console, you will be able to set up an API key and an OAuth application.
For the API key, you just click the API key option in the create credentials button and you'll be able to copy the key.
When you create the OAuth client ID, you'll get a Client ID and a Client secret which you'll use later.
Also, you need to add the authorized redirect URLs that you'll get from the Alexa Skill Developer Console.
You'll need to create a Custom Search so you can get images from google results. https://cse.google.com
When you add a search engine, you'll need to specify in what domains the search will be performed in the "Sites to search" fields.
Then go to the control panel for the newly created search engine. Make sure you have enabled the images search.
Click on the Search engine ID button to and take note of that code.
Ok, now we need to create the Alexa Skill in the Amazon Developers console.
- Create a new custom skill
- Choose an invocation name
- Set up the interaction model. Intent schema, custom slots types and sample utterances are provided in the
/speechAssetsfolder in the code repository.
- In the configuration tab you need to setup the account linking.
- Set up the endpoint, we'll use a lambda function, we'll setup this step after we have created the lambda function and obtain an ARN. (Lambda function id)
A skill ID will be assigned to your newly created skill.
Account linking well let you authorize the skill to do manage the user printers.
You got the client id in the Google developers console
These are the Redirect URLs you have to authorize in the Google OAuth configuration step.
You got the client secret from the Google developers console
We need to set where the skill should make a call with the payload after it already understood the voice input using the interaction model.
In this case, we are using AWS Lambda function.
You'll get the ARN from the lambda function after you create it.
ENDPOINT USING LAMBDA FUNCTIONS
Go to de AWS console to create a new lambda function with the application that will provide the skill the functionality.
- Create a new function starting from the blank template
- Configure the triggers
- Configure function
- Add environmental variables to configure de application
- Build and upload the code
Once you create the function, you'll get the ARN which you need to setup the Alexa Skill endpoint.
Configure the triggers
Choose the Alexa Skills Kit
You'll need to choose a name and choose
as a runtime
Setup the application
Set the following environmental variables:
- ALEXA_APP_ID: is the skill ID you got when the skill was created.
- CSE_API_KEY: is the API key you created in the developers console
- CSE_CS: is the Search Engine ID you got when setting up custom search
Build and upload the application
You'll need to clone the git repository from Github.
git clone https://github.com/blackjid/coloring-pages-skill cd coloring-pages-skill
Install the project dependencies
The project is written in Typescript so you'll need to compile it before uploading it to lambda.
npm run build
The build script on the
built folder and compress the
built folder into
Now you can upload the zip file to your lambda function.
Did you replicate this project? Share it!I made one
Love this project? Think it could be improved? Tell us what you think!