This is an example chatbot implemented with Dialogflow that allows you to get METAR informations of your favorite airport.
A simple example of what you can ask
You: What's the METAR for LFPG?
Chatbot: LFPG 081600Z 23012KT 9999 SCT044 BKN260 11/02 Q1017 NOSIG
You can also ask specifically for visibility
You: What's the visibility for LFPO?
Chatbot: Visibility is 9999
You can test a live demo version here
You'll need some packages to run this example :
If you want to deploy the webhook, you'll need a firebase account
NB: Firebase cloud functions can only run on Node V6 or V8, I choose the 8.15.1 as it is the latest LTS for Node 8.
nvm use
cd functions && npm install
You can run the project with :
firebase serve
You can run tests by running :
npm test
You can also run mocha directly with :
npm run mocha
To build the project :
npm run predeploy
To upload it on Firebase :
firebase deploy
APIKEY = Define the API KEY used to access the API (default: IAMANAPIKEY)
WEATHER_URL = Define the weather service endpoint (default: https://avwx.rest)
WEATHER_TIMEOUT = Weather service timeout (default: 30000)
This project is not full ready for production.
In order to do so, we need to add :
- more functionnalities (this is a test!)
- metrics (Grafana?)
- a logger / alerting system (like Sentry?)
- documentation (Swagger for example)
I used the free API https://avwx.rest to retrieve METAR airport information.