This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "dialogflowFirebaseFulfillment", | |
"description": "Cloud Functions for Firebase", | |
"scripts": { | |
"lint": "eslint .", | |
"serve": "firebase serve --only functions", | |
"shell": "firebase functions:shell", | |
"start": "npm run shell", | |
"deploy": "firebase deploy --only functions", | |
"logs": "firebase functions:log", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
name: 'simpleresponse', | |
title: 'Simple Response', | |
type: 'document', | |
fields: [ | |
{ | |
name: 'title', | |
title: 'Title', | |
type: 'string' | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import createSchema from 'part:@sanity/base/schema-creator' | |
import schemaTypes from 'all:part:@sanity/base/schema-type' | |
import simpleResponse from './simpleresponse' | |
// Then we give our schema to the builder and provide the result to Sanity | |
export default createSchema({ | |
// We name our schema | |
name: 'dialogflow', | |
// Then proceed to concatenate our document type | |
// to the ones provided by any plugins that are installed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const functions = require('firebase-functions'); | |
const sanityClient = require('@sanity/client'); | |
const { | |
WebhookClient, | |
Payload | |
} = require('dialogflow-fulfillment'); | |
process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements | |
const client = sanityClient({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"hangouts": { | |
"header": { | |
"title": "Pizza Bot Customer Support", | |
"subtitle": "[email protected]", | |
"imageUrl": "https://goo.gl/aeDtrS" | |
}, | |
"sections": [ | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function playOutput(arrayBuffer){ | |
let audioContext = new AudioContext(); | |
let outputSource; | |
try { | |
if(arrayBuffer.byteLength > 0){ | |
console.log(arrayBuffer.byteLength); | |
audioContext.decodeAudioData(arrayBuffer, | |
function(buffer){ | |
audioContext.resume(); | |
outputSource = audioContext.createBufferSource(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>RecordRTC over Socket.io</title> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
<script src="https://www.WebRTC-Experiment.com/RecordRTC.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const TVGUIDE_WEBSERVICE = 'https://tvguide-f36xvzb5da-ew.a.run.app/channel'; | |
const { WebhookClient } = require('dialogflow-fulfillment'); | |
const rp = require('request-promise'); | |
const moment = require('moment'); | |
process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements | |
exports.tvguide = function(request, response){ | |
var agent = new WebhookClient({ request, response }); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const local = { | |
"1": [{ | |
"titel": "Journaal", | |
"datum_start": "2018-07-26 15:00:00" | |
}, { | |
"titel": "Journaal", | |
"datum_start": "2018-07-26 15:20:00" | |
}, { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('dotenv').config() //load environemnt vars | |
const projectId = process.env.GCLOUD_PROJECT; //your project name | |
const uuidv1 = require('uuid/v1'); | |
const sessionId = uuidv1(); | |
const languageCode = 'en-US'; | |
const server = require('http').createServer((request, response) => { | |
response.writeHead(200, {"Content-Type": "text/html"}); |