Giter Club home page Giter Club logo

alexa-todoist's Introduction

Todoist Alexa Skill

This is a skill built for Amazon's Alexa service that tells allows you to manage your Todoist Tasks and Projects. It was built because the out of the box Alexa Todoist integration is very basic and doesn't allow you to add tasks to projects, create projects, complete tasks etc.

By default tasks that are added without specifying a project get added to your Inbox.

You can ask Alexa the following:

Projects:

Alexa, ask Todoist to create project Home DIY

Alexa, ask Todoist to create a project called Home DIY

Tasks/Items:

Alexa, ask Todoist to add task Paint radiator

Alexa, ask Tododist to add task Paint radiator to project Home DIY

Alexa, ask Todoist to add task Paint radiator for 1st January 2017 at Four PM

Alexa ask Todoist to add task Paint radatior for 1st January 2017

Deleting Tasks/Items:

Alexa, ask Todoist to delete task Paint radiator

Completing Tasks/Items:

Alexa, ask Tododist to complete task Paint radiator

Alexa, ask Todoist to uncomplete task Paint radiator

If you are just starting out developing skills for Alexa, it's worth reading Getting Started with the Alexa Skills Kit and Developing an Alexa Skill as a Lambda Function. Also you may want to get familiar with the Alexa Skills Kit SDK for Node.js which this skill uses.

Setup

Creating a Todoist App

Before you can configure the skill, you need to create an App in the Todoist developer site. This will allow the skill full access to your Todoist account.

  1. Head over to the Todoist Developer site
  2. Click 'Create New App'
  3. Give your app a name e.g. alexa-todoist-skill and enter a valid URL (can be anything)
  4. Scroll down and click 'Create Test Token'
  5. Copy the value shown as you will need this to configure the skill

Configuring The Skill

  1. Copy default.env to .env
  2. Fill in the correct values for TODOIST_EMAIL, which is your e-mail address for Todoist, TODOIST_PASSWORD which is fairly obvious and TODOIST_ACCESS_TOKEN which is the token you copied from the step above.

Testing the skill Locally

You can use lambda-local to test the skill locally. In the test_events directory you will find event files that you can use for testing, these should map to most of the intents. Some intents require responses so cannot be tested locally unless the code is modified to hardcode various the value of some variables.

To use lambda-local, run lambda-local -l index.js -e test_events/addtask.json -t 30, where addtask.json is the name of the event file you want to test with. Make sure you run npm install from the command line to get the latest npm packages first.

Packaging the Skill

  1. Run an npm install at the root folder of the project to get all the dependencies.
  2. Run npm run bundle which will create a lambda.zip file in the root of the folder.

Deploying the Skill

The skill is built to be hosted on Amazon's AWS Lambda service.

  1. Go to the AWS Console and click on the 'Lambda' link.
  2. Click on the 'Create a Lambda function' button.
  3. Skip the blueprint by clicking 'Configture triggers'.
  4. Set the trigger to be 'Alexa Skills Kit' and click 'Next'.
  5. Give your Lambda function a name e.g. 'Todoist-Skill'.
  6. Select the runtime as Node.js
  7. Select Code entry type as 'Upload a .ZIP file' and upload the lambda.zip file created above.
  8. Keep the Handler as index.handler (this refers to the main js file in the zip).
  9. Select "Create a new role from template(s)" and set a role name e.g. 'todoistskill'.
  10. Scroll down and click 'Next'.
  11. Review the information and click 'Create function'.
  12. When the funtion has been created, copy the ARN from the top right to be used later in the Alexa Skill Setup.

Direct depoyment from the Command line coming soon once I've tested it!

Setting up the Skill in Alexa

  1. Go to the Alexa Console and click 'Add a New Skill'.
  2. Set 'Todoist' for the skill name and choose an invocation name, this is what you use to activate your skill - I chose 'to do' as Alexa struggles to understand the phrase 'todoist'!
  3. Select the Lambda ARN for the skill Endpoint and paste the ARN copied from above. Click 'Next'.
  4. Copy the custom slot types from the customSlotTypes folder. Each file in the folder represents a new custom slot type. The name of the file is the name of the custom slot type, and the values in the file are the values for the custom slot.
  5. Copy the Intent Schema from the included IntentSchema.json.
  6. Copy the Sample Utterances from the included sample_utterances.txt file. Click 'Next'.
  7. You are now able to start using the skill! You should be able to go to the Echo page and see your skill enabled.
  8. In order to test it, try to say some of the Sample Utterances from the Examples above.
  9. Repeat the above for each language/region you want to use the skill in. I am based in the UK so use English (UK).

You will notice that the custom slot values above are extremely random - this is deliberate! The LITERAL slot type that allowed any speech to be captured is deprecated. I decided to use Amazon's recommended approach of custom slot types. Because we are creating tasks/projects which could be called anything we can't define a list of values (which is the way custom slot types work). I've been told you should create a sensible list of possible values but I found Alexa weighted the speech too heavily to these values so random values yielded better results in returning what the user said correctly.

alexa-todoist's People

Contributors

alexc-msft avatar

Watchers

 avatar

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.