This file contains 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 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 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"}); |
This file contains 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
//https://us-central1-leeboonstra-blogdemos.cloudfunctions.net/tvguidefeed?channels=4&days=0 | |
'use strict'; | |
const {WebhookClient} = require('dialogflow-fulfillment'); | |
const {Card, Suggestion} = require('dialogflow-fulfillment'); | |
const rp = require('request-promise'); | |
process.env.DEBUG = 'dialogflow:debug'; // enables lib debugging statements |
This file contains 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 functions = require('firebase-functions'); | |
const { | |
dialogflow, | |
Suggestions, | |
Image, | |
BasicCard, | |
MediaObject, | |
List, |
This file contains 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 { | |
dialogflow | |
} = require('actions-on-google'); | |
const pug = require('pug'); | |
/* | |
* Uses Pug.js https://pugjs.org/language/plain-text.html | |
* Requires a Dialogflow custom payload like: |
This file contains 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 { | |
dialogflow | |
} = require('actions-on-google'); //version 2.1.1 | |
const assistantHandler = (conv) => { | |
console.log('Dialogflow Request headers: ' + JSON.stringify(conv.headers)); | |
console.log('Dialogflow Request body: ' + JSON.stringify(conv.body)); | |
This file contains 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
// See https://github.com/dialogflow/dialogflow-fulfillment-nodejs | |
// for Dialogflow fulfillment library docs, samples, and to report issues | |
'use strict'; | |
const functions = require('firebase-functions'); | |
const {WebhookClient} = require('dialogflow-fulfillment'); | |
const {Card, Suggestion} = require('dialogflow-fulfillment'); | |
const rp = require('request-promise'); | |
This file contains 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": "my-tvguide-agent", | |
"description": "Build the TV Guide agent for Google Assistant with Dialogflow", | |
"version": "1.0.0", | |
"license": "Apache-2.0", | |
"author": "Lee Boonstra", | |
"engines": { | |
"node": "^8" | |
}, | |
"dependencies": { |
This file contains 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
Follow Procedure Produced Errors: | |
Download https://www.raspberrypi.org/downloads/raspbian/ (2018-03-13) unzip, and burn to SD card with https://etcher.io/ | |
Select a working WIFI network. | |
To open a terminal you can use: CTRL + ALT + T | |
git clone https://github.com/google/aiyprojects-raspbian.git AIY-projects-python | |
sudo apt-get install python-virtualenv |