How to use alexa-app - 10 common examples

To help you get started, we’ve selected a few alexa-app examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github primaryobjects / chatskills / lib / chatskills.js View on Github external
add: function(namespace) {
        // Add a new skill (app namespace).
        this.apps[namespace] = new alexa.app(namespace);
        return this.apps[namespace];
    },
github bbrookfield / node-alexa-server / app_modules / directTV / index.js View on Github external
'use strict';
var request = require('request');
var alexa = require('alexa-app');
var directTVApp = new alexa.app('directTV');

// process set temperature request
directTVApp.intent('setChannel', function(req, res) {
  request.get(process.env.DVR_URL + '/tv/tune?major=' + parseInt(req.slot('Channel')));
  res.card("Direct TV Skill","TV set to channel " + parseInt(req.slot('Channel')));
  res.say("I have set the TV to channel " + parseInt(req.slot('Channel')) + " as requested");
});

module.exports = function(cb) {
  global.tv = directTVApp;
  cb();
};
github mseminatore / alexa-tesla / index.js View on Github external
"use strict";

//var _ = require('lodash');
//var request = require('request');

var tjs = require("teslajs");
var Alexa = require('alexa-app');
var Levenshtein = require('levenshtein');

// Allow this module to be reloaded by hotswap when changed
module.change_code = 1;

var app = new Alexa.app('tesla');

// tell alexa-app to be sure to fully expand utterance generation!
// TODO - this may NOT actually be required OR desirable
app.exhaustiveUtterances = true;

// ENV variables used for configuration

// set these if you are using username/password auth [NOT RECOMMENDED for security!]
var username = process.env.USER;
var password = process.env.PASS;

// set this if you are using a Tesla acquired OAuth token
var token = process.env.TOKEN;

// set this if you want to have the code verify the AppID
var appid = process.env.APPID || 0;
github alexa-js / alexa-app-server / examples / apps / hello_world / index.js View on Github external
var alexa = require('alexa-app');

// Allow this module to be reloaded by hotswap when changed
module.change_code = 1;

// Define an alexa-app
var app = new alexa.app('hello_world');
app.id = require('./package.json').alexa.applicationId;

app.launch(function(req, res) {
  res.say("Hello World!!");
});

app.intent('NameIntent', {
  "slots": { "NAME": "LITERAL", "AGE": "NUMBER" },
  "utterances": ["{My name is|my name's} {matt|bob|bill|jake|nancy|mary|jane|NAME} and I am {1-100|AGE}{ years old|}"]
}, function(req, res) {
  res.say('Your name is ' + req.slot('NAME') + ' and you are ' + req.slot('AGE') + ' years old');
});

app.intent('AgeIntent', {
  "slots": { "AGE": "NUMBER" },
  "utterances": ["My age is {1-100|AGE}"]
github reger-men / Alexa_YouTube / src / node_modules / alexa-app / example / lambda.js View on Github external
var alexa = require("alexa-app");
var find = require("find-my-iphone");

var app = new alexa.app();
app.launch(function(request, response) {
  find("me@icloud.com", "mypassword", "iPhone", function() {
    response.say("OK").send();
  });
  // because this is an async handler
  return false;
});

// connect to lambda
exports.handler = app.lambda();
github reger-men / Alexa_YouTube / src / index.js View on Github external
// Required packages
var alexa = require("alexa-app");
var request = require("request");
var ssml = require("ssml-builder");
var response_messages = require("./responses");


var StorePath = '/tmp/PlayList_'; /*NOTE: /tmp/ folder in AWS is an non-persistent scratch area.*/
var PlayListPath = '';
var PlayListTitles = [];
var PlayListIndex = 0;
var CurrentPlayList = '';

// Create Alexa skill application
var app = new alexa.app("youtube");

// Set Heroku URL
var heroku = process.env.HEROKU_APP_URL || "https://youtube-alexa.herokuapp.com";

// Variables relating to the last video searched
var metadata = null;
var last_search = null;
var is_play_list = false;
var last_token = null;
var last_playback = {};
var lang = "en-US";  // TO DEFINE: Valid entry en-US, de-DE, fr-FR, it-IT

// Current song is repeating
var repeat_infinitely = false;
var repeat_once = false;
github dmhacker / alexa-youtube-skill / src / index.js View on Github external
"use strict";

// Setup Python-esque formatting
String.prototype.formatUnicorn = String.prototype.formatUnicorn || require("./util/formatting.js");

// Required packages
let alexa = require("alexa-app");
let request = require("request");
let ssml = require("ssml-builder");
let response_messages = require("./util/responses.js");

// Create Alexa skill application
let app = new alexa.app("youtube");

// Process environment variables 
const HEROKU = process.env.HEROKU_APP_URL || "https://dmhacker-youtube.herokuapp.com";
const INTERACTIVE_WAIT = !(process.env.DISABLE_INTERACTIVE_WAIT === "true" ||
  process.env.DISABLE_INTERACTIVE_WAIT === true ||
  process.env.DISABLE_INTERACTIVE_WAIT === 1);
const CACHE_POLLING_INTERVAL = Math.max(1000, parseInt(process.env.CACHE_POLLING_INTERVAL || "5000", 10));
const ASK_INTERVAL = Math.max(30000, parseInt(process.env.ASK_INTERVAL || "45000", 10));

// Maps user IDs to recently searched video metadata
let buffer_search = {};

// Maps user IDs to last played video metadata
let last_search = {};
let last_token = {};
let last_playback = {};
github OverloadUT / alexa-plex / lib / common.js View on Github external
var alexa = require('alexa-app');
var app = new alexa.app('plex');

var common = {
    plex: null, // This will get set by index.js
    pinAuth: null, // This will get set by index.js
    app: app,
    CONFIDICE_CONFIRM_THRESHOLD: 0.4
};

module.exports = common;
github dblock / alexa-parrot / functions / parrot / parrot.js View on Github external
const alexa = require('alexa-app');

const app = new alexa.app('parrot');

app.launch((req, res) => {
  res.say('I am a parrot.');
});

app.intent('RepeatIntent', {
  slots: {VALUE: 'AMAZON.NUMBER'},
  utterances: ['repeat {-|VALUE}', 'to repeat {-|VALUE}']
}, (req, res) => {
  const value = req.slot('VALUE') || 2;

  res.say(`You said ${value}.`);
  for (let i = 0; i < value; i++) {
    res.say(`I repeat, you said ${value}.`);
  }
});
github bignerdranch / alexa-airportinfo / index.js View on Github external
'use strict';
module.change_code = 1;
var _ = require('lodash');
var Alexa = require('alexa-app');
var app = new Alexa.app('airportinfo');
var FAADataHelper = require('./faa_data_helper');

app.launch(function(req, res) {
  var prompt = 'For delay information, tell me an Airport code.';
  res.say(prompt).reprompt(prompt).shouldEndSession(false);
});

app.intent('airportinfo', {
  'slots': {
    'AIRPORTCODE': 'FAACODES'
  },
  'utterances': ['{|flight|airport} {|delay|status} {|info} {|for} {-|AIRPORTCODE}']
},
  function(req, res) {
    //get the slot
    var airportCode = req.slot('AIRPORTCODE');

alexa-app

A module to simplify creation of Alexa (Amazon Echo) apps (Skills) using Node.js

MIT
Latest version published 6 years ago

Package Health Score

48 / 100
Full package analysis

Popular alexa-app functions