GithubHelp home page GithubHelp logo

eisenjulian / holidays Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 35 KB

Google assistant bot that knows about holidays in Argentina

License: MIT License

JavaScript 100.00%
nodejs apiai assistant assistant-chat-bots chatbot

holidays's Introduction

Holiday Pal

Google assistant bot that knows about holidays in Argentina based on api.ai and Google Cloud Functions

Requirements

  1. Install Node.js
  2. Install Google Cloud SDK
  3. Install ngrok to test locally
  4. Create an api.ai account
  5. Have or create a Google Cloud Project with Cloud Functions API and billing enabled

Setup

$ git clone https://github.com/eisenjulian/holidays.git
$ cd holidays
$ # install dependencies
$ npm install
$ # install cloud functions emulator
$ npm install -g @google-cloud/functions-emulator
$ gloud init
$ gcloud components update && gcloud components install beta
$ gcloud config set project <project_id>
$ # create a bucket in Google Cloud Storage to store files: if you use a different name update package.json
$ gsutil mb gs://holiday-bot-bucket
$ # deploy your cloud function
$ # in the logs you will get the URL for your cloud function to use in the api.ai integrations page
$ npm run deploy
  1. Use the Actions on Google Console to add a new project with a name of your choosing.
  2. Click "Use API.AI" and then "Create Actions on API.AI" which will redirect you to api.ai.
  3. Click "Save" to save the project.
  4. Click on the gear icon to see the project settings.
  5. Select "Export and Import".
  6. Select "Restore from zip". Follow the directions to restore from the holidayPal.zip in this repo.
  7. In the Fulfillment page of the API.AI console, enable Webhook, set the URL to the hosting URL, then save.
  8. Open API.AI's Integrations page, open the Settings menu for Actions on Google, then click Test.
  9. Click View to open the Actions on Google simulator.
  10. Type "Talk to my test app" in the simulator, or say "OK Google, talk to my test app" to any Actions on Google enabled device signed into your developer account.

To update the Cloud Function

$ npm run deploy

To test locally

$ functions start
$ npm run start
$ <ngrok_location>/ngrok http 8010

You will get a URL that looks like https://XXXXXX.ngrok.io/<you-project>/<your-zone>/holidayPal that points to your local server and where changes are updated immediately. Go to your api.ai agent integrations page and update the webhook. Don't forget to change it back when you're done testing

Acknowledgements

holidays's People

Contributors

eisenjulian avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.