##install.packages("curl") 
##install.packages("jsonlite")
library("curl")
library("jsonlite")

navstevnost_globus_phzli <- fromJSON("https://gapi.globus.cz/counterService/api/v1/counter/market/3")
navstevnost_globus_cb <- fromJSON("https://gapi.globus.cz/counterService/api/v1/counter/market/4")
navstevnost_globus_brno <- fromJSON("https://gapi.globus.cz/counterService/api/v1/counter/market/15")


prodejny <- c('Praha Zličín','České Budějovice','Brno')
navstenosti <- c(navstevnost_globus_phzli$counter/navstevnost_globus_phzli$marketConfig$maxCounter*100,
                 navstevnost_globus_cb$counter/navstevnost_globus_cb$marketConfig$maxCounter*100,
                 navstevnost_globus_brno$counter/navstevnost_globus_brno$marketConfig$maxCounter*100)


prodejny.navstenosti <- data.frame(prodejny, navstenosti)

