Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Japan Tour in Summer: てらだよしおまつり in 関西Day1 / jaz...

gaomar
August 07, 2019

Japan Tour in Summer: てらだよしおまつり in 関西Day1 / jazug-0807

Japan Tour in Summer: てらだよしおまつり in 関西Day1
https://jazug.connpass.com/event/136591/

gaomar

August 07, 2019
Tweet

More Decks by gaomar

Other Decks in Programming

Transcript

  1. JOUFSBDUJWF@DBOWBTNJOKTΛJOEFYIUNMͰݺͼग़͢ <!DOCTYPE html> <html lang="en"> <head> // লུ <!-- Load

    Interactive Canvas JavaScript --> <script src="https://www.gstatic.com/assistant/interactivecanvas/api/interactive_canvas.min.js"></script> </head> <body> <noscript> <strong>We're sorry but nesthub-demo doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> </noscript> <div id="app"></div> <!-- built files will be auto injected --> </body> </html>
  2. <script> export default { methods: { start () { //

    Google Assistantʹ ʮελʔτʯ ͱ͍͏จࣈྻΛૹΔ interactiveCanvas.sendTextQuery('ελʔτ'); } } } </script> JOUFSBDUJWF$BOWBTTFOE5FYU2VFSZͰ (PPHMF"TTJTUBOUʹૹΔ
  3. <script> export default { data () { return { seikai:

    '', yomi: '' } }, created () { var me = this const callbacks = { onUpdate(state) { // ໰୊ͷ஋͕ඈΜͰ͖ͨΒऔಘ͢Δ if ('katsuzetsu' in state) { me.seikai = data.katsuzetsu.seikai, me.yomi = data.katsuzetsu.yomi } }, } interactiveCanvas.ready(callbacks) } } </script> JOUFSBDUJWF$BOWBTSFBEZͰ (PPHMF"TTJTUBOU͔ΒͷԠ౴Λ଴ͭ
  4. )UNM3FTQPOTFͷEBUBʹ7VFKTʹ౉͢஋Λઃఆ͢Δ // ׈ઉνΣοΫ app.intent('MainIntent', (conv, {word}) => { const context

    = conv.contexts.get('game'); if (context.parameters.seikai === word) { conv.contexts.delete('game'); conv.ask(`͓ΊͰͱ͏ʂʂੌ͘׈ઉΑ͔ͬͨͰ͢Αɻɹ${context.parameters.yomi}ɹͱݴ͍ͬͯΔͷ͕͸͖ͬΓฉ ͖औΕ·ͨ͠ɻଓ͚ͯ׈ઉνΣοΫΛ͠·͔͢ʁ`); } else { conv.ask(`͍͢·ͤΜɻ׈ઉ͕ѱͯ͘ฉ͖औΕ·ͤΜͰͨ͠ɻ΋͏Ұ౓ࢼͯ͠Έ·͠ΐ͏ɻ`); conv.ask(new HtmlResponse({ url: `https://katsuzetsu-app.netlify.com/katsuzetsu`, data: { katsuzetsu: context.parameters } })); } });
  5. $ mkdir katsuzetsu-app-functions $ cd katsuzetsu-app-functions $ func init #

    બ୒ࢶ͕ग़ͯ͘ΔͷͰnodeͱjavascriptΛબͿ $ func new # Http triggerΛબ୒͠ɺkatsuzetsu-appͱ͍͏໊લͰ࡞੒͢Δ $ npm init -y $ npm i -s [email protected] # 2.10.0ΛೖΕΔ $ npm i -s azure-function-express # azure-function-expressΛೖΕΔ $ npm i -s express $ npm i -s firebase-admin "[VSFͷ؀ڥΛߏங
  6. $ mkdir katsuzetsu-app-functions $ cd katsuzetsu-app-functions $ func init #

    બ୒ࢶ͕ग़ͯ͘ΔͷͰnodeͱjavascriptΛબͿ $ func new # Http triggerΛબ୒͠ɺkatsuzetsu-appͱ͍͏໊લͰ࡞੒͢Δ $ npm init -y $ npm i -s [email protected] # 2.10.0ΛೖΕΔ $ npm i -s azure-function-express # azure-function-expressΛೖΕΔ $ npm i -s express $ npm i -s firebase-admin ݄೔ʹਖ਼ࣜϦϦʔε