Alohakrisi avatar image
Alohakrisi asked

Date-aware skills

I would like to create calendars which are aware of the current date and reply with date-specific responses. An example of that would be an Advent calendar that might detect that it's December 25th and prompt the user to "have a merry Christmas".

While I have some ideas of how parts of this work I am hazy on how it would come together. DynamoDB would probably be used to save the data and the dates.

Perhaps the fact skill sample code could be tweaked to remove the random fact and instead point to the Dynamo DB table.

Alternatively slots might be used.

Does anyone have any sample code or have the link to a tutorial? Alternatively maybe Amazon could create a sample skill. Lots of businesses could benefit from programming an entire year's worth of date-aware content into a skill.

alexa skills kitcalendar
10 |5000

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

1 Answer

Rokas avatar image
Rokas answered

Everything you said is pretty much correct and doable. I have a skill which relies heavily on dates. You could provide the date as you said from the slot or you could take todays date in the backend and return an appropriate response or with new functionality you could get it from users device (haven't tried that though, but it is definetly possible).

The only thing I would recommend beforehand is using momentjs library, because working with base JS date object is pretty painful. Also as a database, I always used mLab mongo db. I am not really a fan of storing anything in dynamoDb except for session attributes, which are integrated to ask-sdk. I feel it is really hard to work with dynamo and write queries for it, while using mongoose with mongoDb is easy as a breeze. But this is only mine own preference, so don't take my word for it.

Talking about samples, I haven't seen any and I don't know when amazon will add a sample skill for that, but I recommend trying to build it, and if you'll have any problems doing it, come back here and ask for help.

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.

Thanks Rokas. I am still quite early on my coding journey and right now I have just started with mongoDB. Thanks for the tipp with MomentsJS, good call. I will probably need some time to grapple with this as I am not in a position to actively just code what I want to see. I might give this a try when I am further along.

0 Likes 0 ·