Skip to content

Commit

Permalink
Merge pull request #3 from meteomatics/feature/version_string
Browse files Browse the repository at this point in the history
add connector tag with version info to query
  • Loading branch information
meteomatics authored Jun 18, 2019
2 parents e547f51 + 7765336 commit 42ebb7b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Meteomatics_Weather_API_PowerBI.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 1 addition & 0 deletions VERSION.R
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VERSION = "2.0.1"
13 changes: 7 additions & 6 deletions query_api_PowerBI.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ library(httr)
library(data.table)
library(lubridate)
library(ggplot2)
source('VERSION.R')

query_user_features = function(username, password)
{
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -103,4 +104,4 @@ query_api = function(username, password, startdate, enddate,

}

}
}

0 comments on commit 42ebb7b

Please sign in to comment.