Running out of project ideas? How about ask Alexa.
All you have to say is : Alexa, ask startup generator to generate my next Hackster project. She would say something like:
So, basically, it's an analytics platform for aquariums.
So, basically, it's like Wearable Computer for Christian Families.
So, basically, it's like Realtime Data for Restroom Attendants!.
So, basically, it's Hackster project idea generator :)
I recently stumbled upon this api. http://itsthisforthat.com/api.php
I figured this would be a fun project for amazon echo. It's a simple project to learn how to call and use an api in Amazon Echo.
If you're interested in this, My app is published in amazon echo. Find this skill - 'What does your startup do?'
If this got you interested in learning how to create Amazon Echo custom skills, or this app gave you an idea for your next Hackster.io project, please add respect and follow me. Thanks.
What does your Startup Do?Here we go:
I followed the instructions from this tutorial:
This will teach the basics of creating a new Alexa skill.
Here's the plan. Call the api, read the results and pass it to alexa.
To call the ItsThisForThat api, use this link
http://itsthisforthat.com/api.php?json
The api would return something like this:
{
"this":"YouTube",
"that":"Sysadmins"
}
Then I just need to parse, this and that.
My speech output would look something like
speechOutput = "SO, basically, it's like a " + data.this + " for " + data.that;
Here's the link to the code
https://gist.github.com/rondagdag/a746cb0ffa97ef7c3d697f889827e268
I modified to accept "StartupDoIntent" to call this function. The StartupDo function would call the ItsThisForThat API and would read data, build the speech output and pass it to Alexa.
function StartupDo(intent, session, callback) {
var cardTitle = "Wait, What does your startup do?";
var repromptText = "";
var sessionAttributes = {};
var shouldEndSession = true;
var speechOutput = "";
getStartupDo(function(data){
//list all the names of state representative
speechOutput = "SO, basically, it's like a " + data.this + " for " + data.that;
callback(sessionAttributes,
buildSpeechletResponse(cardTitle, speechOutput, repromptText, shouldEndSession));
});
}
This would call the web api, read all the contents of the response.
function getStartupDo(callback) {
return http.get({
host: 'itsthisforthat.com',
path: '/api.php?json'
}, function(response) {
// Continuously update stream with data
var body = '';
response.on('data', function(d) {
body += d;
});
response.on('end', function() {
// Data reception is done, do whatever with it!
var parsed = JSON.parse(body);
callback(parsed);
});
});
}
That's it.
You can use the same pattern on other api.
Here are some of projects published in Amazon Echo.
Random Cat FactsAPI is provided by catfacts-api.appspot.com
Just say:
Alexa ask random cat to tell me a fact
Alexa ask random cat what's the fact
Alexa tell random cat to say what
Code:
https://gist.github.com/rondagdag/57e9bacbe9006773cf0f3cf93731677e
Pirate Talk TranslatorAlexa speaks like a pirate. Translate your words into Pirate Speak. Let Alexa Talk Like A Pirate. API provided by www.isithackday.com
Just say:
Alexa tell pirate talk to translate How are you
Alexa tell pirate talk to say Who are you
Alexa tell pirate talk to convert I am your father
Code:
https://gist.github.com/rondagdag/b4e64e42c6db83fc5066182580b421a4
Yoda SpeakTurn your sentences into Yoda-speak!
Credits to http://www.yodaspeak.co.uk/ for providing the service.
Tips:
-Please don't just try "Hello." Nothing will change. Yoda won't answer back, he'll just repeat. It's not the same thing as a conversation.
-Yoda speaks short sentences for a reason. If the result is total garbage, that could be why!
-Make sure you use proper english grammar and punctuation, our little green friend can't read your mind. "Don't", instead of "Dont", and so on.
-The exception is this: You should use extra punctuation if a sentence contains more than one clause, often split with 'and', 'or', etc. For example: "Put your hands up and step away from the turnip." should be "Put your hands up, and step away from the turnip." or "Put your hands up. Step away from the turnip."
alexa ask master yoda to say You will learn how to speak like me someday.
Oh wait.
alexa tell master yoda to say you must clear your mind
alexa tell master yoda to translate the mind of a child is truly wonderful
Code:
https://gist.github.com/rondagdag/3b8bf62e0e90e158740ebd6cdd0f8dc5
If this got you interested in learning how to create Amazon Echo custom skills, or this app gave you an idea for your next Hackster.io project, please add respect and follow me. Thanks.
Comments