Break apart Yahoo API requests into no more than 50 symbols at a time
Yahoo has recently started limiting the number of symbols you can request at a time. I wasn't able to figure out the exact limit, but somewhere between 65 and 100 symbols at once will return a "429 Too Many Requests" error, causing ticker to just display a mostly blank page with no symbols appearing at all. This patch breaks things up into requests of no more than 50 symbols at a time.
Thanks for identifying this issue and proposing a fix!
I'll need to test this a bit to understand the limitation better. I don't have a good solution at the moment but there's also a good chance that this will start to get blocked after a certain number of symbols are added to the watchlist since it will issue N / 50 requests in parallel where N is the number of symbols on the watchlist.
Agreed, I thought a better way would be to do maybe 50 at a time and rotate between which batch of 50 gets polled per interval, but I was having trouble making that work where only a partial result got returned each time.So far with about 300 symbols I haven't hit any rate limits this way, but I'm guessing eventually Yahoo will stop this too.
At some point in the last week or so, Yahoo stopped returning an error when sending my full (~300) symbol list, and the currently released version works again. I'm not sure if this patch is still needed, but it still might be a good idea to not go crazy on what we're requesting from Yahoo to hopefully give them no reason to turn this back on.
This pr is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.