# -------------------------------------------------------------------------------- 

                "All of this is setup -- should go in the 00 file."
                "-------------------------------------------------"
# -------------------------------------------------------------------------------- 
{
  .us()
  minDate.global <- as.Date("2013-04-01")  ## The numbers are sloppy for 2013 Jan-March

  setScienceIfNot("Spotify_Streams_Per_Top_Artist", load=FALSE)
  # setScience("Spotify_Streams_Per_Top_Artist", create=TRUE, subl=FALSE, load=TRUE)

  lib(rjson,    quiet=TRUE)
  lib(RCurl,    quiet=TRUE)
  lib(reshape2, quiet=TRUE)
  lib(ggplot,   quiet=TRUE)
  lib(bit64,    quiet=TRUE)

  sourceSupportFns()
  sourceEntireFolder(src.p("load DTs"))

  {
    if (exists("DTs.list") || exists("DT.nms"))
      saveImageTo(subProj="before next scrape")
    else
      loadImageOf(projName=getProjName(), subProj="main")
  }


  countries.avail <- c("global", DT.spotify_countries[, country_code])
  # dates.avail  <- head(as.character(seq.Date(as.Date("2013-04-28"), Sys.Date()+1, by="7 days")), -1)  ## I thought that there would be a rounding issue with the date, but I amy have been wrong
  dates.avail  <- as.character(seq.Date(as.Date("2013-04-28"), Sys.Date(), by="7 days"))

  ## Threshold for number of items that must be returned to be considered valid for the territory
  nrowThresh <- 46 ## NOT USED

 }
# -------------------------------------------------------------------------------- 