From 319e04001c3775fcaaf60fa1c7805323edd6aa4e Mon Sep 17 00:00:00 2001 From: FatAussieFatBoy Date: Mon, 18 Dec 2017 11:25:36 +1000 Subject: [PATCH 1/4] Added Units Added unit compatibility to see if the person wants the temperature in Celsius, Kelvin, Rankine and Fahrenheit. --- app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 26cc594adf..d23753c65b 100755 --- a/app.py +++ b/app.py @@ -51,10 +51,11 @@ def makeYqlQuery(req): result = req.get("result") parameters = result.get("parameters") city = parameters.get("geo-city") + unit = parameters.get("units") if city is None: return None - return "select * from weather.forecast where woeid in (select woeid from geo.places(1) where text='" + city + "')" + return "select * from weather.forecast where woeid in (select woeid from geo.places(1) where text='" + city + "') and u='" + unit + "'" def makeWebhookResult(data): From 0c034c3f42c32023cbddb577d1ef6b5a1ed86f4f Mon Sep 17 00:00:00 2001 From: FatAussieFatBoy Date: Mon, 18 Dec 2017 11:27:43 +1000 Subject: [PATCH 2/4] Update app.json --- app.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.json b/app.json index 831c944ffd..953c02dd03 100644 --- a/app.json +++ b/app.json @@ -1,5 +1,5 @@ { - "name": "Dialogflow webhook demonstration", + "name": "ApiAi webhook", "description": "Dialogflow webhook demonstration", "repository": "https://github.com/api-ai/apiai-weather-webhook-sample", "logo": "http://xvir.github.io/img/apiai.png", From 942f2fa956a434349670060ca7d97ecdfca10c9d Mon Sep 17 00:00:00 2001 From: FatAussieFatBoy Date: Mon, 18 Dec 2017 11:38:08 +1000 Subject: [PATCH 3/4] Update app.json --- app.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app.json b/app.json index 953c02dd03..768cd2eae5 100644 --- a/app.json +++ b/app.json @@ -1,7 +1,7 @@ { - "name": "ApiAi webhook", - "description": "Dialogflow webhook demonstration", + "name": "API.AI webhook demonstration", + "description": "API.AI webhook demonstration", "repository": "https://github.com/api-ai/apiai-weather-webhook-sample", "logo": "http://xvir.github.io/img/apiai.png", - "keywords": ["api.ai", "dialogflow", "natural language"] + "keywords": ["api.ai", "natural language"] } From 56cbba36631b3fa0e1e15dd6d83c7f9fef0648c7 Mon Sep 17 00:00:00 2001 From: FatAussieFatBoy Date: Tue, 19 Dec 2017 19:13:04 +1000 Subject: [PATCH 4/4] Changed Given Temperature to Celsius --- app.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app.py b/app.py index d23753c65b..a924cf1161 100755 --- a/app.py +++ b/app.py @@ -51,11 +51,10 @@ def makeYqlQuery(req): result = req.get("result") parameters = result.get("parameters") city = parameters.get("geo-city") - unit = parameters.get("units") if city is None: return None - return "select * from weather.forecast where woeid in (select woeid from geo.places(1) where text='" + city + "') and u='" + unit + "'" + return "select * from weather.forecast where woeid in (select woeid from geo.places(1) where text='" + city + "') and u='c'" def makeWebhookResult(data):