![]() I use a cookie blocker but had to whitelist to retain the cookie for future browser sessions. It also appears to work with Chrome, but you will need to use the cookie crumb for Chrome. Lapply(assetList,, from, to, envir = globalenv(), crumb = crumb, DLdir)}Ĭoded in RStudio on Mac OSX 10.11 using Safari as my default browser. You can also use with lapply to get a list of asset data from <- "" Note that this will leave an "untitled" window open in the browser.After downloading, the csv file is removed from your download.Set envir = as.environment("yourEnvir") - defaults to globalenv().Set DLdir to the default download directory in your browser.Copy the crumb after "&crumb=" and use it in the function call.Right click on "download data" and copy the link.# assign the xts file to the specified environmentĪssign(symbol, yahoo.xts, envir = as.environment(envir)) # convert date as character to date format #' try increasing the time for Sys.sleep(time = x) #' it's because the csv file has not completed downloading #' if you get: Error in file(file, "rt") : cannot open the connection YahooDF <- utils::read.csv(yahooCSV, header = TRUE) YahooCSV <- paste(DLdir, symbol, ".csv", sep = "") #' wait 500 msec for download to complete - mileage may vary #' DLdir defaults to download directory in browser preferences #' run the query - downloads the security as a csv file YahooURL <- paste(query1, query2, quer圓, sep = "") Quer圓 <- paste("&interval=", interval, "&events=history&crumb=", crumb, sep = "") Interval <- switch(period, daily = "1d", weekly = "1wk", monthly = "1mo") Query2 <- paste("period1=", fromPosix, "&period2=", toPosix, sep = "") ![]() <- function (symbol,įromPosix <- as.numeric(as.POSIXlt(from)) Superfluous as it now may be, I coded a fix that shows one approach to get around the download problem. ![]() Fortunately, help is on the way courtesy Joshua Ulrich. I've always wondered why Yahoo was so nice as to provide data downloads and how screwed I would be if they stopped doing it. map ( extractQuote ) const sumQuote = (, ) => const sumAllQuotes = allQuotes => allQuotes. ** * RxJS in Action * Listing 5.4 * Note: make sure you have turned on CORS sharing in you browser so that you can make * cross-site requests * Paul Daniels * Luis Atencio */ const ajax = url => new Promise ( ( resolve, reject ) => ] ) => // 3-tuple const fetchQuote$ = symbol => requestQuote$ ( symbol ). ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |