Code Monkey home page Code Monkey logo

academyalexaswift's Introduction

Alexa Swift

(aka. League Assistant)

Project Overview

./Sources/main.swift

Description: This project provides a demonstration of how to develop for the Amazon Echo. With this skill the user is capable to ask Alexa for the statistics of the enemy team in League of Legends the video game, and know what they should care about.

Prerequisites
Alexa configuration

Go to the Alexa Developer Console and select Alexa Skill Kit. Click Add new skill.

The next steps show you what information is necessary on each Alexa tab. If you notice there is information missing just leave the field blank or their default values.

Skill Information Name: lol assistant Invokation name: League assistant

Interaction Model

  • Click Launch Skill Builder
  • Go to Code editor tab.
  • Drag and drop InteractionModel.json.
  • Apply changes.
  • Save and build model.
  • Go back to the skill configuation by clicking Configuration

Configuration

  • Service Endpoint Type: HTTPS
  • Geographical region: North America/Europe (Any)
  • You will get the endpoint using ngrok. Check the next step for that.
Getting local endpoint

In your terminal run ngrok http 8081 You will get a https endpoint, which is the hook for your skill.

CouchDB configuration

Before running the project, is recommended to have CouchDB running. By default, it runs on port 5984.

  • Open you manager ( http://127.0.0.1:5984/_utils/ ), and under the admin panel create a new admin. Remember this credentials.
  • Log out from CouchDB by clicking Log out just at the bottom of the page, left side.
  • Open again the manager and log in with your credentials.
  • Go to Databases and Create Database.
  • Input the name of your desired Database and click Create. Super easy, right? Relax.
Setting up the project
  • Within your terminal clone the project, and cd the project directory.
  • Copy ./Sources/AppConstants.swift.example as ./Sources/AppConstants.swift
  • Edit that file by adding your LoL API Key in the apiKey filed.
  • Edit the host and port of the database if it doesn't match with your configuration.
  • Add the name of the database in the name field, also input your admin and password database in their respective fields.
Building and running the project

Install dependences and build project with swift build

If successful, run the project with ./.build/debug/SwiftEcho Your server will run into the port 8081.

Also, you can generate the xcode project using. swift package generate-xcodeproj

  • Note, if you are coding withing xode, be sure to change the scheme before running. You should select the last SwiftEcho, and run on My Mac.

Testing the skill

Back in the Alexa portal, we have the Test tab under your skill configuration. Go there. In the Service simulatour you can try different stuff to test your skill. Some examples are:

  • open league asistant
  • log in with ID two zero eight one seven three eight and region Latin America North
  • give me statistics

๐Ÿป

academyalexaswift's People

Stargazers

 avatar

Watchers

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

Forkers

osuka42g dmaulikr

academyalexaswift's Issues

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.