# NOT RUN {
# }
# NOT RUN {
# get a webproperty per account
getAccountInfo <- gar_api_generator(
"https://www.googleapis.com/analytics/v3/management/accounts",
"GET", data_parse_function = function(x) unique(x$items$id))
getWebpropertyInfo <- gar_api_generator(
"https://www.googleapis.com/analytics/v3/management/", # don't use sprintf to construct this
"GET",
path_args = list(accounts = "default", webproperties = ""),
data_parse_function = function(x) x$items)
walkData <- function(){
# here due to R lazy evaluation
accs <- getAccountInfo()
gar_batch_walk(getWebpropertyInfo,
walk_vector = accs,
gar_paths = list("webproperties" = ""),
path_walk = "accounts",
batch_size = 100, data_frame_output = FALSE)
}
# do the walk
walkData()
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab