Eliah avatar image
Eliah asked

Skill for question "when is the next bus to ...?"

Hi everyone,

I want to create a alexa skill with which I can ask the following question:

when is the next bus to ...?

Here it should be possible to say something like "Main station" or a name of a bus stop in my city.

I know how to get the data from the local transportation api but I do not know how I can implement it in alexa.

Has anyone of you an idea how such an idea can be implemented?

Thank you!

skillalexaalexa skills
1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Joseph Kesselman avatar image Joseph Kesselman commented ·

You'll get more help if you ask a more specific question. Say what you've done so far, and what it isn't doing that you need it to do. If you haven't done much yet, go looking through the Alexa Skill examples and tutorials on the web and on github, find one that does something similar to what you want to do, and try adapting it; that was the easiest way I found to get started.

In general: Write an Alexa conversational model that understands the kinds of questions you want to ask, using slots to capture the variable input. Write an Alexa handler (typically as a lambda) which accepts the intents you defined in that model, reads the slot values, formats them as needed for the transportation API, calls that API (I've been using the "Got" class for Javascript to do the HTML call), formats the response and speaks it back to the user. Note that since Javascript calls to the network are usually asynchronous, you'll need to understand how to deal with async/await in Javascript, and your handler routine will need to be declared as async.

For more detail, see those tutorials and examples. Websearching "alexa bus schedule skill" finds some specifically related material.

0 Likes 0 ·

0 Answers