Closed leontegral closed 3 years ago
Thanks for the report! That's frustrating that curl::curl_download()
didn't fix it on AWS, like it did for #97.
Am I correct that the second block of code that calls curl::curl_download()
was done on AWS, even though the comment says # on laptop
?
Is the AMI you're using something that others can get a copy of and try to replicate?
Thanks for the quick reply! Yes -- that was on AWS. Just corrected the comment. And the AMI is a standard AWS AMI (https://aws.amazon.com/amazon-linux-ami/2018.03-release-notes/)
More generally, I wonder if it might be better to use an alternative source given that the NASDAQ site seems to have some anti-scraping measures. A vanilla curl on my laptop gets a 403 access denied. A possible alternative is ftp://ftp.nasdaqtrader.com/symboldirectory/ (which was suggested in #5 )
2 thoughts:
getListings(src, ...)
that dispatches to getListing.src(...)
, following the getSymbols
pattern. This would open up a lot of flexibility in what get returned, and allow people to choose the source that best suits their needsquantmod
instead of TTR
i'll submit a contribution:
GetSymbolList.tiingozip <- function(...) {
tmp.file <- tempfile()
on.exit(unlink(tmp.file))
download.file("https://apimedia.tiingo.com/docs/tiingo/daily/supported_tickers.zip", tmp.file, quiet = T)
return(read.csv(unz(tmp.file, "supported_tickers.csv")))
}
I am having similar issue, and only need to get the list of stocks and not any real ticker quote. Is there any workaround?
Same here, error I'm getting is in RStudio on my local laptop:
symbols <- TTR::stockSymbols() Fetching AMEX symbols... Error in file(file, "rt") : cannot open the connection In addition: Warning message: In file(file, "rt") : InternetOpenUrl failed: 'The operation timed out'
Hi everyone, sorry I didn't get to this over the weekend. I was very ill. I'm feeling better, but have limited time to work on OSS during the week. I'm going to get something working this morning, but it will not be polished. I will need to update documentation and add some tests before I release to CRAN.
Josh, so sorry to hear you were sick. Hope you feel better soon.
Pushed a first draft this morning. A few things that still need to happen before I merge and release.
Description
Running TTR::stockSymbols() in R 3.6 console on AWS EC2 (Linux) started failing this week. Running on my laptop (OSX) in R 3.6 works. I am running the development version from Github including the latest commit with the change to
curl_download()
.Note that TTR::getYahooData(), though deprecated, works in both environments.
I am guessing this has to do with the Nasdaq's website's restrictions on agent/browser/IP address? It would be great if there were an alternative source, preferably an API, so that we didn't have to rely on scraping.
Expected behavior
TTR::stockSymbols() runs without error.
Minimal, reproducible example
(stalls for minutes)
(nothing for minutes)
Session Info
laptop:
AWS EC2: