From 0b02b99b6da4bb5d9ce3f7dd15e1983f60724fe2 Mon Sep 17 00:00:00 2001 From: Markus Neumann Date: Tue, 18 Jun 2019 10:20:25 +0200 Subject: [PATCH 1/4] add connector tag with version info to query --- Meteomatics_Weather_API_PowerBI.R | 2 +- VERSION.R | 1 + query_api_PowerBI.R | 13 +++++++------ 3 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 VERSION.R diff --git a/Meteomatics_Weather_API_PowerBI.R b/Meteomatics_Weather_API_PowerBI.R index 3703a75..a822df0 100755 --- a/Meteomatics_Weather_API_PowerBI.R +++ b/Meteomatics_Weather_API_PowerBI.R @@ -33,4 +33,4 @@ if (request_type == "timeseries"){ } #Data from the API -output = query_api(username, password, startdate, enddate, interval, parameters, coordinate) +output = query_api(username, password, startdate, enddate, interval, parameters, coordinate, time_zone = time_zone) diff --git a/VERSION.R b/VERSION.R new file mode 100644 index 0000000..ead0b7c --- /dev/null +++ b/VERSION.R @@ -0,0 +1 @@ +VERSION = "v2.0.1" diff --git a/query_api_PowerBI.R b/query_api_PowerBI.R index c7e9fe2..50c67c4 100755 --- a/query_api_PowerBI.R +++ b/query_api_PowerBI.R @@ -4,6 +4,7 @@ library(httr) library(data.table) library(lubridate) library(ggplot2) +source('VERSION.R') query_user_features = function(username, password) { @@ -38,7 +39,7 @@ api_domain = function(query) query_api = function(username, password, startdate, enddate, interval, parameters, coordinate, request_type="timeseries", - model="mix" + model="mix", time_zone="UTC" ) { #def Variabeln @@ -48,8 +49,8 @@ query_api = function(username, password, startdate, enddate, #URL if(request_type == "timeseries") { - query = sprintf("https://%s:%s@api.meteomatics.com/%s--%s:%s/%s/%s/csv?model=%s", - username, password, startdate_query, enddate_query, interval, parameters, coordinate, model + query = sprintf("https://%s:%s@api.meteomatics.com/%s--%s:%s/%s/%s/csv?model=%s&connector=PowerBI_connector_v%s", + username, password, startdate_query, enddate_query, interval, parameters, coordinate, model, VERSION ) result = api_timeseries(query) @@ -78,8 +79,8 @@ query_api = function(username, password, startdate, enddate, return(df_timeseries) } else { - query = sprintf("https://%s:%s@api.meteomatics.com/%s/%s/%s/csv?model=%s", - username, password, startdate_query, parameters, coordinate, model + query = sprintf("https://%s:%s@api.meteomatics.com/%s/%s/%s/csv?model=%s&connector=PowerBI_connector_v%s", + username, password, startdate_query, parameters, coordinate, model, VERSION ) result = api_domain(query) @@ -103,4 +104,4 @@ query_api = function(username, password, startdate, enddate, } -} \ No newline at end of file +} From ab0af0f500d8cf71851d7941596cc8299f33d21a Mon Sep 17 00:00:00 2001 From: Markus Neumann Date: Tue, 18 Jun 2019 10:23:47 +0200 Subject: [PATCH 2/4] remove 'v' from connector string --- query_api_PowerBI.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/query_api_PowerBI.R b/query_api_PowerBI.R index 50c67c4..f0b9044 100755 --- a/query_api_PowerBI.R +++ b/query_api_PowerBI.R @@ -49,7 +49,7 @@ query_api = function(username, password, startdate, enddate, #URL if(request_type == "timeseries") { - query = sprintf("https://%s:%s@api.meteomatics.com/%s--%s:%s/%s/%s/csv?model=%s&connector=PowerBI_connector_v%s", + query = sprintf("https://%s:%s@api.meteomatics.com/%s--%s:%s/%s/%s/csv?model=%s&connector=PowerBI_connector_%s", username, password, startdate_query, enddate_query, interval, parameters, coordinate, model, VERSION ) From 499d159b2cc13b003b1205a3c7d0a043f2d50ff2 Mon Sep 17 00:00:00 2001 From: Markus Neumann Date: Tue, 18 Jun 2019 10:29:44 +0200 Subject: [PATCH 3/4] Revert "remove 'v' from connector string" This reverts commit ab0af0f500d8cf71851d7941596cc8299f33d21a. --- query_api_PowerBI.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/query_api_PowerBI.R b/query_api_PowerBI.R index f0b9044..50c67c4 100755 --- a/query_api_PowerBI.R +++ b/query_api_PowerBI.R @@ -49,7 +49,7 @@ query_api = function(username, password, startdate, enddate, #URL if(request_type == "timeseries") { - query = sprintf("https://%s:%s@api.meteomatics.com/%s--%s:%s/%s/%s/csv?model=%s&connector=PowerBI_connector_%s", + query = sprintf("https://%s:%s@api.meteomatics.com/%s--%s:%s/%s/%s/csv?model=%s&connector=PowerBI_connector_v%s", username, password, startdate_query, enddate_query, interval, parameters, coordinate, model, VERSION ) From 7765336cd305588a2d957d76d8f91dde04090af9 Mon Sep 17 00:00:00 2001 From: Markus Neumann Date: Tue, 18 Jun 2019 10:33:33 +0200 Subject: [PATCH 4/4] don't use 'v' twice... --- VERSION.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.R b/VERSION.R index ead0b7c..b46c2e7 100644 --- a/VERSION.R +++ b/VERSION.R @@ -1 +1 @@ -VERSION = "v2.0.1" +VERSION = "2.0.1"