GithubHelp home page GithubHelp logo

alexa-samples / skill-sample-nodejs-feed Goto Github PK

View Code? Open in Web Editor NEW
106.0 42.0 61.0 115 KB

An Alexa Skill Template to help create skills that read RSS/Atom feeds.

License: Other

JavaScript 93.37% PowerShell 4.00% Shell 2.63%

skill-sample-nodejs-feed's Introduction

Build An Alexa Feed Reader Skill

Voice User InterfaceLambda FunctionConnect VUI to CodeTestingCustomizationPublication

Build a Feed Reader Skill for Alexa

This tutorial will walk first-time Alexa skills developers through all the required steps involved in creating a feed reading skill using a template called ‘Feed Reader’. Ask to play your feed and this skill will do so.

Let's Get Started

If this is your first time here, you're new to Alexa Skills Development, or you're looking for more detailed instructions, click the Get Started button below:

Be sure to take a look at the Additional Resources at the bottom of this page!

About

Note: The rest of this readme assumes you have your developer environment ready to go and that you have some familiarity with CLI (Command Line Interface) Tools, AWS, and the ASK Developer Portal. If not, click here for a more detailed walkthrough.

Usage

Alexa, ask feed reader to open first feed.
	>> Your first feed is BBC World News.

Alexa, open feed reader

Repository Contents

Setup w/ ASK CLI

Pre-requisites

Installation

  1. Clone the repository.

    $ git clone https://github.com/alexa/skill-sample-nodejs-feed/
  2. Initiatialize the ASK CLI by Navigating into the repository and running npm command: ask init. Follow the prompts.

    $ cd skill-sample-nodejs-feed
    $ ask init
  3. Install npm dependencies by navigating into the /lambda/custom directory and running the npm command: npm install

    $ cd lambda/custom
    $ npm install

Deployment

ASK CLI will create the skill and the lambda function for you. The Lambda function will be created in us-east-1 (Northern Virginia) by default.

  1. Deploy the skill and the lambda function in one step by running the following command:

    $ ask deploy

Testing

  1. To test, you need to login to Alexa Developer Console, and enable the "Test" switch on your skill from the "Test" Tab.

  2. Simulate verbal interaction with your skill through the command line using the following example:

     $ ask simulate -l en-US -t "start feed reader"
    
     ✓ Simulation created for simulation id: 4a7a9ed8-94b2-40c0-b3bd-fb63d9887fa7
    ◡ Waiting for simulation response{
      "status": "SUCCESSFUL",
      ...
  3. Once the "Test" switch is enabled, your skill can be tested on devices associated with the developer account as well. Speak to Alexa from any enabled device, from your browser at echosim.io, or through your Amazon Mobile App and say :

    Alexa, start feed reader
    

Customization

  1. ./skill.json

    Change the skill name, example phrase, icons, testing instructions etc ...

    Remember that many information is locale-specific and must be changed for each locale (en-GB and en-US)

    See the Skill Manifest Documentation for more information.

  2. ./lambda/custom/index.js

    Modify messages, and facts from the source code to customize the skill.

  3. ./models/*.json

    Change the model definition to replace the invocation name and the sample phrase for each intent. Repeat the operation for each locale you are planning to support.

Additional Resources

Community

Tutorials & Guides

  • Voice Design Guide - A great resource for learning conversational and voice user interface design.
  • CodeAcademy: Learn Alexa - Learn how to build an Alexa Skill from within your browser with this beginner friendly tutorial on CodeAcademy!

Documentation

skill-sample-nodejs-feed's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

skill-sample-nodejs-feed's Issues

Intent Schema creation error

Hello,
While creating the Intent Schema, I get an error message : "Error: There was a problem with your request: Unknown slot type 'ORDINAL' for slot 'ORDINAL'"

Any idea why would it do that?
Best regards,

[Warn]: File \skill.json not exists.

Hello, I followed the following steps, in VSCode:

$ git clone https://github.com/alexa/skill-sample-nodejs-feed/
$ cd skill-sample-nodejs-feed
$ ask init
Skill Id: ENTER
Skill Package Path: /
Lambda code: ./lambda
UseAWS CloudFormation to deply lambda? Yes
Lambda runtime: nodejs12.x
Lambda handler: index.handler
$ ask deploy

After typing ask deploy, inside the folder skill-sample-nodejs-feed, it gives the following error:

[Warn]: File \skill.json does not exist.

This is because in the Skill Package Path I just put /. What should I put? I've tried several directories, but it's not working.
Thanks!

Read Item in details.

'readItemSpeechHelper' : function () {
// Output sorry message to user. Metrics created using cloudwatch logs to see how many users requests are made
const message = 'Sorry, this feature is not available.'
+ constants.breakTime['250'] +
'You can continue navigating through the feed by saying next.';
this.response.speak(message).listen(message);
this.emit(':responseReady');

//How do I get the skill to read "Item" details content rather than just title and summary if the feature is not available.

Cannot convert undefined or null to object

after setting up everything i am getting this error in while testing the skill in Alexa developer
There was a problem with the requested skill's response then i put that json response in lambda test and i got the following
{ "errorType": "TypeError", "errorMessage": "Cannot convert undefined or null to object", "trace": [ "TypeError: Cannot convert undefined or null to object", " at Function.keys (<anonymous>)", " at Object.NewSession (/var/task/eventHandlers.js:28:20)", " at AlexaRequestEmitter.emit (events.js:198:13)", " at AlexaRequestEmitter.EventEmitter.emit (domain.js:448:20)", " at AlexaRequestEmitter.EmitEvent (/var/task/node_modules/alexa-sdk/lib/alexa.js:161:10)", " at AlexaRequestEmitter.HandleLambdaEvent (/var/task/node_modules/alexa-sdk/lib/alexa.js:124:23)", " at AlexaRequestEmitter.value (/var/task/node_modules/alexa-sdk/lib/alexa.js:74:31)", " at Runtime.exports.handler (/var/task/index.js:20:11)", " at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)" ] }

Log output

The section below shows the logging calls in your code. These correspond to a single row within the CloudWatch log group corresponding to this Lambda function. Click here to view the CloudWatch log group.

START RequestId: f8127006-ae68-429b-b470-302b76bf3619 Version: $LATEST 2020-01-06T04:38:56.104Z f8127006-ae68-429b-b470-302b76bf3619 INFO Warning: Application ID is not set 2020-01-06T04:38:56.144Z f8127006-ae68-429b-b470-302b76bf3619 INFO {"eventType":"SessionStarted","event":{"userId":"amzn1.ask.account.AH5DAZ5QFPLU5NKA5XSU7PKCHUK4KCQTEUB3BBOSQ7COBQQ5EKW45X2445QZXZQJHO5HLXHIWSCPQ6TR2XYOZCPBG3GKDPQVWZK4WQN4OUWCNUW52WSLMZ2BBD4AANIR5SWIWQ5TJ6SSWN6KN5ZE73Q5UC6IBMONJ6MU6TRLLKFWUV3RKV7FE5P3SWODM23WJDXRVYBYDNZRRPY","sessionId":"amzn1.echo-api.session.92ab8d8e-8262-4f21-9f54-e556d78a8a6f","datestring":"2020-01-06T04:38:56.144Z"}} 2020-01-06T04:38:56.163Z f8127006-ae68-429b-b470-302b76bf3619 INFO Unexpected exception 'TypeError: Cannot convert undefined or null to object': TypeError: Cannot convert undefined or null to object at Function.keys (<anonymous>) at Object.NewSession (/var/task/eventHandlers.js:28:20) at AlexaRequestEmitter.emit (events.js:198:13) at AlexaRequestEmitter.EventEmitter.emit (domain.js:448:20) at AlexaRequestEmitter.EmitEvent (/var/task/node_modules/alexa-sdk/lib/alexa.js:161:10) at AlexaRequestEmitter.HandleLambdaEvent (/var/task/node_modules/alexa-sdk/lib/alexa.js:124:23) at AlexaRequestEmitter.value (/var/task/node_modules/alexa-sdk/lib/alexa.js:74:31) at Runtime.exports.handler (/var/task/index.js:20:11) at Runtime.handleOnce (/var/runtime/Runtime.js:66:25) 2020-01-06T04:38:56.163Z f8127006-ae68-429b-b470-302b76bf3619 ERROR Invoke Error {"errorType":"TypeError","errorMessage":"Cannot convert undefined or null to object","stack":["TypeError: Cannot convert undefined or null to object"," at Function.keys (<anonymous>)"," at Object.NewSession (/var/task/eventHandlers.js:28:20)"," at AlexaRequestEmitter.emit (events.js:198:13)"," at AlexaRequestEmitter.EventEmitter.emit (domain.js:448:20)"," at AlexaRequestEmitter.EmitEvent (/var/task/node_modules/alexa-sdk/lib/alexa.js:161:10)"," at AlexaRequestEmitter.HandleLambdaEvent (/var/task/node_modules/alexa-sdk/lib/alexa.js:124:23)"," at AlexaRequestEmitter.value (/var/task/node_modules/alexa-sdk/lib/alexa.js:74:31)"," at Runtime.exports.handler (/var/task/index.js:20:11)"," at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)"]} END RequestId: f8127006-ae68-429b-b470-302b76bf3619 REPORT RequestId: f8127006-ae68-429b-b470-302b76bf3619 Duration: 96.25 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 102 MB Init Duration: 567.43 ms
i have tried adding unhandled function but nothing happened i am unable to understand the issue please help!!

"TimeoutError: Missing credentials in config"

Each time I try to deploy the code of this sample I run into this error:

{ [TimeoutError: Missing credentials in config]
message: 'Missing credentials in config',
code: 'CredentialsError',
time: Wed Mar 22 2017 11:20:34 GMT+0100 (CET),
originalError:
{ message: 'Could not load credentials from any providers',
code: 'CredentialsError',
time: Wed Mar 22 2017 11:20:34 GMT+0100 (CET),
originalError:
{ message: 'Connection timed out after 1000ms',
code: 'TimeoutError',
time: Wed Mar 22 2017 11:20:34 GMT+0100 (CET) } } } 'TimeoutError: Missing credentials in config\n at ClientRequest. (/Users/xyz/Documents/svn lokal/alexa_feed/skill-sample-nodejs-feed/bin/node_modules/aws-sdk/lib/http/node.js:56:34)\n at ClientRequest.g (events.js:180:16)\n at ClientRequest.emit (events.js:92:17)\n at Socket.emitTimeout (http.js:1798:10)\n at Socket.g (events.js:180:16)\n at Socket.emit (events.js:92:17)\n at Socket._onTimeout (net.js:327:8)\n at _makeTimerTimeout (timers.js:438:11)\n at Timer.unrefTimeout [as ontimeout] (timers.js:502:5)'

I do have a valid credentials file in my ~/.aws directory. The only thing that is different from your sample: I use EU/Ireland as region. This is set in my ~/.aws config file too.

Any ideas?

Not fetching up the feed and giving defined error

Always saying when selecting a category to listen up the feed from added url

Error
Sorry, there are some technical difficulties in fetching the requested information. Please try again later.

it am stuck here please help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.