Inspiration
We came into this Hackathon as blank slates with no firm plans in place. Listening to the representatives from the Rock and Roll Hall of Fame and AWS, though, we were inspired to create an app that would increase engagement with RRHoF voters by giving them an additional way to interact with the process.
What it does
Our app gives Alexa a new skill and allows users to prompt her to return the list of this year's nominees or vote for one of them.
How we built it
The landing page is a bare-bones html file, and the Alexa interaction was built following the tutorial that Amazon provides via their Alexa github page.
Challenges we ran into
Initially, we planned to have Alexa also play clips of songs by the nominees. This was scrapped due to time constraints. Also, the version of this app that we're presenting only appears to interact with the landing page; we struggled with DynamoDB and settled for a hardcoded version that would work to present.
Accomplishments that we're proud of
We're proud that we got an Alexa skill flushed out enough to work and respond to vocal commands.
What we learned
We learned the basic ins-and-outs of the Alexa framework and that enabling back-end interaction is more time consuming than we first expected.
What's next for Rock and Roll Hall of Fame
Next, we'd like to overcome the obstacles that we ran into: primarily offering a way (within our Alexa skill) to play clips of songs by the nominees, fetch the nominees from rockhall.com (rather than hardcoded as we currently have it) and enable voting to interact with the database on the back end.
Current Lambda Code
/* eslint-disable func-names / / eslint quote-props: ["error", "consistent"]/ /*
- This sample demonstrates a simple skill built with the Amazon Alexa Skills
- nodejs skill development kit.
- This sample supports multiple lauguages. (en-US, en-GB, de-DE).
- The Intent Schema, Custom Slots and Sample Utterances for this skill, as well
- as testing instructions are located at https://github.com/alexa/skill-sample-nodejs-fact **/
'use strict'; const Alexa = require('alexa-sdk');
//========================================================================================================================================= //TODO: The items below this comment need your attention. //=========================================================================================================================================
//Replace with your app ID (OPTIONAL). You can find this value at the top of your skill's page on http://developer.amazon.com. //Make sure to enclose your value in quotes, like this: const APP_ID = 'amzn1.ask.skill.bb4045e6-b3e8-4133-b650-72923c5980f1'; //const APP_ID = undefined;
const SKILL_NAME = 'Rock and Roll Hall of Fame Nominees'; const WELCOME_MESSAGE = "Welcome to Rock and Roll Hall of Fame Nominees!" const GET_LIST_MESSAGE = "These are the bands nominated this year: "; const HELP_MESSAGE = "Say list, to hear this year's nominees, or say vote, to vote for one of them."; const HELP_REPROMPT = 'What else can I help you with?'; const STOP_MESSAGE = 'Goodbye!';
//========================================================================================================================================= //TODO: Replace this data with your own. You can find translations of this data at http://github.com/alexa/skill-sample-node-js-fact/lambda/data //=========================================================================================================================================
/const languageStrings = { 'en': { 'translation': { 'WELCOME' : "Welcome to Rock and Roll Hall of Fame Nominees!", 'HELP' : "Say list, to hear this year's nominees, or say play, to play clips from their songs, or say vote, to vote for one of them.", 'STOP' : "Okay, see you next time!" } } };/ const bands = [ "Bon Jovi", "The Cars", "Dire Straits", "Nina Simone", "Sister Rosetta Tharpe", "The Cars", "Nickelback" ];
//========================================================================================================================================= //Editing anything below this line might break your skill. //=========================================================================================================================================
exports.handler = function(event, context, callback) { let alexa = Alexa.handler(event, context);
// alexa.appId = 'amzn1.echo-sdk-ams.app.1234';
///alexa.dynamoDBTableName = 'YourTableName'; // creates new table for session.attributes
//alexa.resources = languageStrings;
alexa.registerHandlers(handlers);
alexa.execute();
};
/exports.handler = function(event, context, callback) { var alexa = Alexa.handler(event, context); alexa.appId = APP_ID; alexa.registerHandlers(handlers); alexa.execute(); };/
const handlers = { 'LaunchRequest': function () { let say = WELCOME_MESSAGE + ' ' + HELP_MESSAGE; this.response.speak(say).listen(HELP_REPROMPT); this.emit(':responseReady'); }, 'ListIntent': function () { let say = GET_LIST_MESSAGE + JSON.stringify(bands) + HELP_REPROMPT;
this.response.cardRenderer(SKILL_NAME, JSON.stringify(bands));
this.response.speak(say).listen(HELP_REPROMPT);
this.emit(':responseReady');
},
'PlayIntent': function () {
let say = GET_LIST_MESSAGE + JSON.stringify(bands) + HELP_REPROMPT;
this.response.cardRenderer(SKILL_NAME, JSON.stringify(bands));
this.response.speak(say).listen(HELP_REPROMPT);
this.emit(':responseReady');
},
'VoteIntent': function () {
let say = "You have cast a vote for Nickelback. Check the vote counts for each nominee at rock hall dot com.";
this.response.cardRenderer(SKILL_NAME, "Voted for Nickelback");
this.response.speak(say).listen(HELP_REPROMPT);
this.emit(':responseReady');
},
'AMAZON.NoIntent': function () {
this.emit('AMAZON.StopIntent');
},
'AMAZON.HelpIntent': function () {
this.response.speak(HELP_MESSAGE).listen(HELP_MESSAGE);
this.emit(':responseReady');
},
'AMAZON.CancelIntent': function () {
this.response.speak(STOP_MESSAGE);
this.emit(':responseReady');
},
'AMAZON.StopIntent': function () {
this.emit('SessionEndedRequest');
},
'SessionEndedRequest': function () {
this.response.speak(STOP_MESSAGE);
this.emit(':responseReady');
}
};
Current JSON Code
{ "languageModel": { "invocationName": "rock and roll", "intents": [ { "name": "AMAZON.CancelIntent", "slots": [], "samples": [] }, { "name": "AMAZON.HelpIntent", "slots": [], "samples": [] }, { "name": "AMAZON.StopIntent", "slots": [], "samples": [] }, { "name": "AMAZON.NoIntent", "slots": [], "samples": [] }, { "name": "ListIntent", "slots": [], "samples": [ "list", "inductees", "nominees", "who is", "who are", "induct", "give me a list" ] }, { "name": "PlayIntent", "slots": [], "samples": [ "play", "play some", "play a clip", "play a sample", "play songs", "play artists", "listen to" ] }, { "name": "VoteIntent", "slots": [ { "name": "bandName", "type": "AMAZON.Musician", "samples": [ "AMAZON.Musician" ] } ], "samples": [ "vote {bandName}", "cast for {bandName}", "choose {bandName}", "vote for {bandName}" ] }, { "name": "options", "slots": [], "samples": [] } ], "types": [] }, "dialog": { "intents": [ { "name": "VoteIntent", "confirmationRequired": false, "prompts": {}, "slots": [ { "name": "bandName", "type": "AMAZON.Musician", "confirmationRequired": false, "elicitationRequired": true, "prompts": { "elicitation": "Elicit.Slot.854963202.1187888309447" } } ] } ] }, "prompts": [ { "id": "Elicit.Slot.854963202.1187888309447", "variations": [ { "type": "PlainText", "value": "Who would you like to vote for?" } ] } ] }
Log in or sign up for Devpost to join the conversation.