From a4b86c4d15fa4d3b4480a827d9aabed3290a4c88 Mon Sep 17 00:00:00 2001 From: Brandon Lee Camilleri Date: Sun, 15 Sep 2019 10:19:54 +0200 Subject: [PATCH] Version 7 of Yahoo! Finance https://github.com/brandleesee/TerminalStocks/blob/master/yahoo_quotes.go --- yahoo_quotes.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/yahoo_quotes.go b/yahoo_quotes.go index 799e1cc..860950d 100644 --- a/yahoo_quotes.go +++ b/yahoo_quotes.go @@ -1,4 +1,4 @@ -// Copyright (c) 2013-2016 by Michael Dvorkin. All Rights Reserved. +// Copyright (c) 2013-2019 by Michael Dvorkin. All Rights Reserved. // Use of this source code is governed by a MIT-style license that can // be found in the LICENSE file. @@ -13,13 +13,10 @@ import ( `strings` ) -// See http://www.gummy-stuff.org/Yahoo-stocks.htm -// -// const quotesURL = `http://download.finance.yahoo.com/d/quotes.csv?s=%s&f=sl1c6k2oghjkva2r2rdyj3j1` -// c2: realtime change vs c1: change -// k2: realtime change vs p2: change -// -const quotesURL = `http://download.finance.yahoo.com/d/quotes.csv?s=%s&f=sl1c1p2oghjkva2r2rdyj3j1` +const quotesURLv7 = `https://query1.finance.yahoo.com/v7/finance/quote?symbols=%s` +const quotesURLv7QueryParts = `&range=1d&interval=5m&indicators=close&includeTimestamps=false&includePrePost=false&corsDomain=finance.yahoo.com&.tsrc=finance` + +const noDataIndicator = `N/A` // Stock stores quote information for the particular stock ticker. The data // for all the fields except 'Advancing' is fetched using Yahoo market API.