.com
#
# and contains buried within 1.5 mbytes of hideous script
#
# <script type="application/json" data-sveltekit-fetched data-url="https://query1.finance.yahoo.com/v1/test/getcrumb?lang=en-US&am
te,Stock Splits
# 2017-05-22,1/5
#
#----------------
# For reference, there's a "v8" which is json format (%7C = "|")
#
# https://query2.finance.yahoo.com/v8/finance/chart/IBM?formatted=true&l
Data Format:
#
# Each of these methods can apparently return results in either CSV or
# JSON format.
#
# The JSON form, maybe CSV too, has prices put through
# single-precision floats, ie. 24 bit mant
o.com/v1/finance/search?q=CSCO&enableFuzzyQuery=false
#
# which is a JSON format of various company information etc.
#
# The JSON looks like
# {"explains":[],
# "count":7,
# "quotes":[
;
my $h = { source => __PACKAGE__,
info => \@info };
require JSON;
my $J = JSON::from_json($content) // {};
my $quotes = $J->{'quotes'} // [];
if (my $e = $quotes->[0]) {
sep18.html");
# new sep 24
my $content = slurp ("$ENV{HOME}/chart/samples/nzx/dividends-sep24-json.html");
my $resp = HTTP::Response->new
(200, 'OK',
['Content-Type' => 'text/html; cha
n would do so.)
#
# Here currently using
# v1 JSON for info (company name, exchange, decimals)
# v8 JSON for historical daily data
# v7 JSON for latest quote
#
# Each seem to be without pr
of these methods returns results in JSON format.
# The "download" URL form(s), as distinct from "chart", were/are CSV
# but might be restricted access now.
#
# JSON has prices put through single-preci
ps to jump through.
# It seemed to be sometimes on the v7 download, maybe always on v11.
# The v7 JSON has been fine asking for the latest few days daily data,
# but not sure about bigger historical d
www.gnu.org/licenses/>.
package App::Chart::Suffix::NZ;
use 5.006;
use strict;
use warnings;
use JSON;
use URI::Escape;
use Locale::TextDomain 'App-Chart';
use App::Chart;
use App::Chart::Database;
at
#
# https://www.nzx.com/markets/NZSX/dividends
#
# The dividend table is buried in a JSON data structure in <script>
# so as minimise the number browsers which will display it.
# As of Se
<\/script>/i
or die "NZX dividends cannot find JSON table";
my $str = $1;
my $json = JSON::from_json($1) // {};
my $props = $json->{'props'} // {};
my $pageProps = $props-
ited recent data)
#
{
# json v7 latest parse
my $filename = "$ENV{HOME}/chart/samples/yahoo/GXY-v7.json";
$filename = "$ENV{HOME}/chart/samples/yahoo/NOSUCH-v7.json";
$filename = "$ENV{HOME
SPC-v7.json";
$filename = "$ENV{HOME}/chart/samples/yahoo/RMX-v7.json";
$filename = "$ENV{HOME}/chart/samples/yahoo/SCG-v7.json";
$filename = "$ENV{HOME}/chart/samples/yahoo/WDC.AX-v7.json";
$
my $decoded = JSON::from_json($content);
print JSON->new->pretty->encode($decoded);
exit 0;
}
{
# v1 info parse
my $filename = "$ENV{HOME}/chart/samples/yahoo/v1-info-CSCO.json";
$filename