Skip to content

monstar-lab/google-home-shiritori

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

google-home-shiritori

You can play "Shiritori" with your Google Home.

Introduction

To use this app, you should

  • have a Google account
  • create Actions on Google
  • deploy Firebase Functions
  • deploy Actions SDK
  • insert data in Firebase Realtime Database

Local environment

  • node (v6.11.5^)
  • gactions (mention later)

clone

  • git clone https://github.com/monstar-lab/google-home-shiritori.git

Creating Actions on Google

  1. Click "Add/import project" on Actions on Google Console
  2. Write down your [project-name (actions)], choose your country and create project
  3. Click "Actions SDK"
  4. Download gactions from the cite of gactions-cli and execute chmod u+x gactions
  5. move gactions to google-home-shiritori

Deploying Firebase Functions

  1. Open your Firebase Console, write down your [project-name (firebase)] [project-id] and create new project
  2. npm install -g firebase-tools
  3. Execute firebase login and login to Firebase-cli according to the instruction
  4. Execute firebase init functions in google-home-shiritori/
  5. Choose [project-name (firebase)]
  6. Answer like below
    ? What language would you like to use to write Cloud Functions? JavaScript
    ? Do you want to use ESLint to catch probable bugs and enforce style? No
    ? File functions/package.json already exists. Overwrite? No
    ? File functions/index.js already exists. Overwrite? No
    ? Do you want to install dependencies with npm now? Yes
    
  7. Deploy firebase deploy --only functions

Deploying Actions SDK

  1. Execute ./gactions init
  2. Edit action.json like below
    {
      "actions": [
        {
          "description": "Default Welcome Intent",
          "name": "MAIN",
          "fulfillment": {
            "conversationName": "shiritoriFunction"
          },
          "intent": {
            "name": "actions.intent.MAIN",
            "trigger": {
              "queryPatterns": [
                "しりとりアプリにつないで"
              ]
            }
          }
        },
        {
          "name": "SHIRITORI",
          "fulfillment": {
            "conversationName": "shiritoriFunction"
          },
          "intent": {
            "name": "actions.intent.TEXT",
            "parameters": {
              "name": "shiritoriWord",
              "type": "Shiritori"
            },
            "trigger": {
              "queryPatterns": [
                "$Shiritori:shiritoriWord"
              ]
            }
          }
        }
      ],
      "conversations": {
        "shiritoriFunction": {
          "name": "shiritoriFunction",
          "url": [URL of Firebase Functions]
        }
      },
      "locale": "ja"
    }
    Your URL of Firebase Functions is displayed on your Firebase Console.
  3. Execute ./gactions update --action_package action.json --project [project名(actions)]

Inserting data in Firebase Realtime Database

  1. Edit data.json. dictionary is the vocabulary list of the Google Home
  2. Click "Database" from Firebase Console
  3. Create Realtime Database and import data from JSON
  4. Import data.json

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published